org.objectweb.jonas.jmx
Class JmxServiceImpl

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byorg.objectweb.jonas.management.ReconfigDispatcher
          extended byorg.objectweb.jonas.service.AbsServiceImpl
              extended byorg.objectweb.jonas.jmx.AbsJmxServiceImpl
                  extended byorg.objectweb.jonas.jmx.JmxServiceImpl
All Implemented Interfaces:
java.util.EventListener, JmxService, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, ReconfigDispatcherMBean, Service

public class JmxServiceImpl
extends AbsJmxServiceImpl
implements javax.management.NotificationListener

JMX Service implementation. Provides specific doStart() and doStop () methods to start /stop JOnAS JMX Service.

Author:
Adriana Danes.

Field Summary
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
JmxServiceImpl()
           
 
Method Summary
 boolean addServer(java.lang.String domainName, java.lang.String serverName, java.lang.String connectorServerURL)
          Add a JOnAS server in the management domain in order update the management domain configuration.
 void doInit(javax.naming.Context ctx)
          Init the logger and then use super method.
 void doStart()
          Start the Service.
 void doStop()
          Stop this service
 javax.management.remote.JMXServiceURL[] getConnectorServerURLs()
           
 java.lang.String getRmiConnectorName()
           
 javax.management.MBeanServerConnection getServerConnection(java.lang.String serverName)
          Return a connection to the JMX serverver of a given JOnAS server
 void handleNotification(javax.management.Notification notification, java.lang.Object handback)
          Treat REGISTRATION/UNREGISTRATION MBeanServerNotification generated for "management" MBeans Treat also notifications generated by Enroller MBean
 void removeServer(java.lang.String domainName, java.lang.String serverName)
          Add a JOnAS server in the management domain
 
Methods inherited from class org.objectweb.jonas.jmx.AbsJmxServiceImpl
getJmxServer, getLogger, releaseJmxServer
 
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.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
handleNotification, 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
getDomainName, getJonasServerName
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

JmxServiceImpl

public JmxServiceImpl()
Method Detail

getRmiConnectorName

public java.lang.String getRmiConnectorName()
Specified by:
getRmiConnectorName in interface JmxService
Returns:
The JNDI name of the JOnAS RMI connector

doInit

public void doInit(javax.naming.Context ctx)
            throws ServiceException
Init the logger and then use super method.

Overrides:
doInit in class AbsJmxServiceImpl
Parameters:
ctx - configuration for the init method
Throws:
ServiceException - if initialization failed

doStart

public void doStart()
             throws ServiceException
Start the Service. Only need to create a RMI connector

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

doStop

public void doStop()
Stop this service

Specified by:
doStop in class AbsJmxServiceImpl

getConnectorServerURLs

public javax.management.remote.JMXServiceURL[] getConnectorServerURLs()
Specified by:
getConnectorServerURLs in interface JmxService
Specified by:
getConnectorServerURLs in class AbsJmxServiceImpl
Returns:
The actual adresses on which listen the created connector servers

handleNotification

public void handleNotification(javax.management.Notification notification,
                               java.lang.Object handback)
Treat REGISTRATION/UNREGISTRATION MBeanServerNotification generated for "management" MBeans Treat also notifications generated by Enroller MBean

Specified by:
handleNotification in interface javax.management.NotificationListener
Parameters:
notification - received notification
handback - received handback

addServer

public boolean addServer(java.lang.String domainName,
                         java.lang.String serverName,
                         java.lang.String connectorServerURL)
Add a JOnAS server in the management domain in order update the management domain configuration.

Parameters:
domainName - name of the management domain the server belongs to
serverName - server name
connectorServerURL - connector server url
Returns:
true if JMX remote connection succeeded

removeServer

public void removeServer(java.lang.String domainName,
                         java.lang.String serverName)
Add a JOnAS server in the management domain

Parameters:
domainName - name of the management domain the server belongs
serverName - server name

getServerConnection

public javax.management.MBeanServerConnection getServerConnection(java.lang.String serverName)
Return a connection to the JMX serverver of a given JOnAS server

Specified by:
getServerConnection in interface JmxService
Parameters:
serverName - The name of the server a connection to its JMX server its needed
Returns:
A connection to that server's JMX server