Hi.
I think I found an acceptable solution to my problem.
Here is the running code:
/**
| * This method enforces an immediate hot deployment of the submitted file.
| * At first, the file will be deployed by the MainDeployer through
| * MBeanServerConnection invocation.
| * The second step is to invoke the DeploymentScanner's scan() method to
achieve
| * an immediate detection of the changes.
| *
| * @param deployFile
| * Name of the file to be deployed (fully-qualified path name)
| *
| * @throws IOException
| * @throws ReflectionException
| * @throws MBeanException
| * @throws InstanceNotFoundException
| * @throws NullPointerException
| * @throws MalformedObjectNameException
| */
| private void hotDeploy(String deployFile)
| throws InstanceNotFoundException, MBeanException, ReflectionException,
| IOException, MalformedObjectNameException, NullPointerException
{
| // Initialize the necessary services once:
| if (mBeanServerConn == null) {
| // Get MBeanServerConnection
| mBeanServerConn = (MBeanServerConnection)
sessionContext.lookup("jmx/invoker/RMIAdaptor");
|
| // Get MainDeployer
| mainDeployer = MainDeployer.OBJECT_NAME;
|
| // Get DeploymentScanner
| deploymentScanner = new
ObjectName("jboss.deployment:type=DeploymentScanner,flavor=URL");
| }
|
| { // Deploy submitted file:
| // Set params for method invocation:
| Object[] params = { deployFile };
| String[] signatures = { "java.lang.String" };
|
| // Invoke the deploy() method of 'mainDeployer'
| mBeanServerConn.invoke(mainDeployer, "deploy", params,
signatures);
| }
|
| { // Enforce immediate scanning of deployment:
| // Set params for method invocation:
| Object[] params = {};
| String[] signatures = {};
|
| // Invoke the scan() method of 'deploymentScanner'
| mBeanServerConn.invoke(deploymentScanner, "scan", params,
signatures);
| }
| }
Holger
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3910238#3910238
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3910238
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user