JMX Integration

Controllers can be deployed as MBeans. The MBean exposes configuration as well as the complete controller interface.

JBoss JMX Deployment

Create a sar with the following layout:
- engagement.sar
  |-- META-INF
  |   |-- concern-process.xml
  |   `-- jboss-service.xml
  `-- org
      `-- concern
          `-- test
              `-- engagement
                  `-- engagement
                      |-- AdvertisedExternally.class
                      |-- AdvertisedInternally.class
                      |-- AllApplicationsDestroyed.class
                      |-- Close.class
                      |-- Closed.class
                      |-- DestroyApplicationIn.class
                      |-- DestroyApplicationOut.class
                      |-- EngagementLoader.class
                      |-- ExternalAdvertising.class
                      |-- InternalAdvertising.class
                      `-- TakeUpJobApplication.class
The jboss-service.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>

<server>

   <mbean code="org.concern.controller.jmx.ControllerService"
name="jboss.concern:name=EngagementController">
       <depends>jboss:service=TransactionManager</depends>
       <depends>jboss.jca:service=LocalTxCM,name=DefaultDS</depends>

       <attribute name="JndiName">java:controller/Engagement</attribute>
       <attribute name="UserTransactionName">UserTransaction</attribute>
       <attribute
name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>

       <attribute name="Datasource">java:DefaultDS</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
       <attribute name="CacheProvider">net.sf.ehcache.hibernate.Provider</attribute>

       <attribute name="ShowSql">true</attribute>
       <attribute name="HbmToDdlAuto">create</attribute>
   </mbean>

</server>
It contains dependencies to the TransactionManager and the Datasource. Further attributes are the jndi name and hibernate properties.