Application server

The MBean application server can be launched using the agent. The script agentserver.cmd is provided to do this. A command line argument can be used to specify the deployment directory. If not present, then the current directory is used.

The application server regularly monitors the deployment directory for deployment descriptors. Upon discovery of a new descriptor, the application server will hot-deploy the associated MBean. When an MBean is deployed, its start() method is invoked, if it has one. Similarly, its stop() method is invoked when it is undeployed.

A URL monitoring service is also provided to enable auto-redeployment when a file is modified.

XML Deployment Descriptor

Descriptor file extension: mbean


<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns:xlink="http://www.w3.org/1999/xlink">
   <mbean name="domain:name=MyName,type=MyType" classname="mypackage.MyClass"/>
<!-- optional constructor element -->
<!-- if not specified, the default no-arg constructor is used -->
   <constructor>
      <parameter value="value1" type="java.lang.String"/>
      <parameter value="value2" type="java.net.URL"/>
   </constructor>
<!-- optional URL monitoring element -->
<!-- the MBean will be redeployed if the URL is modified, the polling interval is in milliseconds -->
   <monitor xlink:href="file:redeployIfModified.jar" interval="1000"/>
<!-- optional classpath elements -->
<!-- the classpath required to deploy the MBean -->
   <classpath xlink:href="file:myapp.jar"/>
   <classpath xlink:href="http://www.jars.org/mylib.jar"/>
</deployment>