MBean documentation
This page will describe how to deploy and use the standard MBean. We will take JBoss3x as an example server.
Note: If you run the MBean in a different environment or server then please send us a quick how-to.
How to install it
The installation requires a few simple steps.
- Copy the jconfig.jar to the $JBOSS_HOME/lib/ext directory.
- Put the following lines in the $JBOSS_HOME/conf/jboss/jboss.jcml (or whereever your jboss.jcml is)
<mbean code="org.jconfig.mbean.ConfigHandler" name=":service=Configuration,name=MyConfig"> <attribute name="ResourceName">config.xml</attribute> <attribute name="ConfigurationName">MyConfig</attribute> <attribute name="AutoReload">false</attribute> <attribute name="ReloadIntervall">1000</attribute> </mbean>
Copy your config.xml (or whatever name you have chosen for your configuration file) to the
$JBOSS_HOME/conf/jboss directory.
Repeat step (3) and (4) for all the different configurations that you need but do not forget to
specidy a different name and a different file.
That's all. The attributes are explained in the next section.
NOTE:
If you run JBoss together with tomcat then the conf-directory is $JBOSS_HOME/conf/tomcat or if
you use Tomcat4 (catalina) then it is $JBOSS_HOME/conf/catalina
Configuring the MBean
We will now explain the attributes in more detail.
ResourceName
This attribute defines the configuration file. It does not have to be a file. You can also
use "http://www.myserver.com/configs/myconfig.xml
". ConfigurationName
This is the name of your configuration instance. If you choose for example "MyConfig" then you
can use the ConfigurationManager in this way:
private static final ConfigurationManager cm = ConfigurationManager.getInstance("MyConfig");
How to build everything
The MBeans are part of the jConfig source distribution.