org.objectweb.jonas.jmx
Class AbsJmxServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
          extended by org.objectweb.jonas.service.AbsServiceImpl
              extended by org.objectweb.jonas.jmx.AbsJmxServiceImpl
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, JmxService, Service
Direct Known Subclasses:
JmxServiceImpl

public abstract class AbsJmxServiceImpl
extends AbsServiceImpl
implements JmxService

JMX Service implementation. This singleton class must exist in each jonas server that is to be administered via JMX. Its main role is to initialize the service (the singleton object).

Author:
Guillaume Riviere, Michel Bruno, Adriana Danes

Field Summary
 
Fields inherited from class org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
AbsJmxServiceImpl()
           
 
Method Summary
 void doInit(Context ctx)
          Init the Service.
abstract  void doStart()
          Start the Service Initialization of the service is already done.
abstract  void doStop()
          Stop this service
 MBeanServer getJmxServer()
           
 MBeanServerConnection getJmxServerConnection()
           
protected static org.objectweb.util.monolog.api.Logger getLogger()
           
 void loadDescriptors(String packageName, ClassLoader cl)
          Load additional mbean descriptors.
 void registerMBean(Object mbean, ObjectName objectName)
          Register an MBean in the JOnAS MBeanServer
 void registerMBean(Object mbean, String objectName)
          Register an MBean in the JOnAS MBeanServer
 void registerModelMBean(Object mbean, ObjectName objectName)
          Register a Model MBean in the JOnAS MBeanServer.
 void registerModelMBean(Object mbean, String objectName)
          Register a Model MBean in the JOnAS MBeanServer.
protected  void releaseJmxServer()
          Remove internal references to the MBeanServer.
 void unregisterMBean(ObjectName objectName)
          Unregister an MBean from the JOnAS MBeanServer
 void unregisterModelMBean(ObjectName objectName)
          Unegister a Model MBean from the JOnAS MBeanServer
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.reconfig.emitter.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.jmx.JmxService
getConnectorServerURLs, getDomainName, getJonasServerName
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

AbsJmxServiceImpl

public AbsJmxServiceImpl()
Method Detail

getLogger

protected static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
Logger logger object

doInit

public void doInit(Context ctx)
            throws ServiceException
Init the Service. Create the MBeanServer. Configuration information is passed through a Context object.

Specified by:
doInit in class AbsServiceImpl
Parameters:
ctx - context containing service initilaisation parameters
Throws:
ServiceException - the service could not be initialized

doStart

public abstract void doStart()
                      throws ServiceException
Start the Service Initialization of the service is already done.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - the service could not be started

doStop

public abstract void doStop()
                     throws ServiceException
Stop this service

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - the service could not be stopped

getJmxServer

public MBeanServer getJmxServer()
Specified by:
getJmxServer in interface JmxService
Returns:
The local reference of the MBean server

getJmxServerConnection

public MBeanServerConnection getJmxServerConnection()
Specified by:
getJmxServerConnection in interface JmxService
Returns:
The Connection interface to the MBean server

registerMBean

public void registerMBean(Object mbean,
                          String objectName)
Register an MBean in the JOnAS MBeanServer

Specified by:
registerMBean in interface JmxService
Parameters:
mbean - MBean object to register
objectName - the String representation of the MBean's ObjectName

registerMBean

public void registerMBean(Object mbean,
                          ObjectName objectName)
Register an MBean in the JOnAS MBeanServer

Specified by:
registerMBean in interface JmxService
Parameters:
mbean - MBean object to register
objectName - the MBean's ObjectName

unregisterMBean

public void unregisterMBean(ObjectName objectName)
Unregister an MBean from the JOnAS MBeanServer

Specified by:
unregisterMBean in interface JmxService
Parameters:
objectName - the MBean's ObjectName

registerModelMBean

public void registerModelMBean(Object mbean,
                               ObjectName objectName)
                        throws Exception
Register a Model MBean in the JOnAS MBeanServer.

Specified by:
registerModelMBean in interface JmxService
Parameters:
mbean - MBean object to register
objectName - the Mbean ObjectName
Throws:
Exception - throwed when registering a modeler MBean

registerModelMBean

public void registerModelMBean(Object mbean,
                               String objectName)
                        throws Exception
Register a Model MBean in the JOnAS MBeanServer.

Specified by:
registerModelMBean in interface JmxService
Parameters:
mbean - MBean object to register
objectName - the Mbean stringified ObjectName
Throws:
Exception - throwed when registering a modeler MBean

unregisterModelMBean

public void unregisterModelMBean(ObjectName objectName)
Unegister a Model MBean from the JOnAS MBeanServer

Specified by:
unregisterModelMBean in interface JmxService
Parameters:
objectName - the Mbean ObjectName

releaseJmxServer

protected void releaseJmxServer()
Remove internal references to the MBeanServer.


loadDescriptors

public void loadDescriptors(String packageName,
                            ClassLoader cl)
Load additional mbean descriptors.

Specified by:
loadDescriptors in interface JmxService
Parameters:
packageName - name of the package containing the descriptors file
cl - class loader containing the resource


Copyright © 2007 OW2 Consortium. All Rights Reserved.