ManageTheDeploymentScannerWithTheJMXConsole

Managing the deployment scanner with the JMX Console

 

To manage the deployment scanner with the JMXConsole:

 

 

1. Open the JMXConsole (for example: http://localhost:8080/jmx-console )

 

 

2. Navigate to the jboss.deployment:flavor=URL,type=DeploymentScanner mbean (hint: you can probably just CTRL-F and enter type=DeploymentScanner in the dialog box)

 

 

 

 

3. click on the DeploymentScanner mbean link.

 

 

 

4. You can change the recusive attribute.  If it is true then directories under the /deploy directory will be scanned for deployments as well.  There are many side effects to this.  Read this for more information.

 

 

 

5. The ScanEnabled attribute is only used when starting the MBean, so changing its value in the JMX console has no effects (unless you subsequently invoke stop() and start()).  If you want to stop the DeploymentScanner from hot deploying changes to the /deploy directory, just invoke its stop() method instead (see below).

 

 

 

6. You can change the scan period (in milliseconds).  The default is 5000 (5 seconds).  If you set it larger, the time between scans of the /deploy directory will increase and it will take longer for JBoss to notice changes and hot deploy them.

 

 

 

7. Once you've made any attribute changes you must "Apply" them before they take effect.

 

 

 

8. In addition to attributes there are operations.  For instance if you wish to add a URL you can do it with the addURL operation (below).  Make sure you pick the signature that takes a String as an argument rather than the URL.  You can enter either relative directories or URLs such as http://centraljbserver.megacorp.com/inventoryControl/deploy.  By default /deploy is scanned.

 

 

 

9. If you wish to determine if a URL is being scanned you can use the hasURL which will return a boolean.  Its very sensitive so make sure you get it right.  Again, pick the String signature.

 

 

 

10. If you wish to remove a url from being scanned, you can use the removeURL.  Again it is sensitive and use the String signature.

 

 

 

11. If you wish to force a scan, you can invoke the scan operation.  This could be useful, for instance, if you had a long scan period and couldn't wait.

 

 

 

12. Finally, you can start and stop the DeploymentScanner.  If stopped, nothing will be hotdeployed.

 

 

 

Notes

 

These changes are runtime changes only.  You may wish to persist these changes.  See Configure The Deployment Scanner for details.