org.mule.management.agents
Class JmxAgent

java.lang.Object
  extended by org.mule.management.agents.JmxAgent
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, Startable, Stoppable, UMOAgent

public class JmxAgent
extends Object
implements UMOAgent

JmxAgent registers MUle Jmx management beans with an MBean server.


Field Summary
static Map DEFAULT_CONNECTOR_SERVER_PROPERTIES
           
static String DEFAULT_JMX_AUTHENTICATOR
          Default JMX Authenticator to use for securing remote access.
static String DEFAULT_REMOTING_URI
           
protected  boolean locateServer
          Should MBeanServer be discovered.
protected static Log logger
          Logger used by this class
 
Constructor Summary
JmxAgent()
          Default constructor.
 
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources. (non-Javadoc)
 Map getConnectorServerProperties()
          Getter for property 'connectorServerProperties'.
 String getConnectorServerUrl()
           
 String getDescription()
          Should be a 1 line description of the agent
 JmxSupportFactory getJmxSupportFactory()
          Getter for property 'jmxSupportFactory'.
 javax.management.MBeanServer getMBeanServer()
           
 String getName()
          Gets the name of this agent
 void initialise()
          Method used to perform any initialisation work.
 boolean isCreateServer()
           
 boolean isEnableStatistics()
           
 boolean isLocateServer()
           
protected  void registerComponentServices()
           
protected  void registerConfigurationService()
           
protected  void registerConnectorServices()
           
 void registered()
           (non-Javadoc)
protected  void registerEndpointServices()
           
protected  void registerModelServices()
           
protected  void registerMuleService()
           
protected  void registerStatisticsService()
           
protected  void registerWrapperService()
          Register a Java Service Wrapper agent.
 void setConnectorServerProperties(Map connectorServerProperties)
          Setter for property 'connectorServerProperties'.
 void setConnectorServerUrl(String connectorServerUrl)
           
 void setCreateServer(boolean createServer)
           
 void setCredentials(Map newCredentials)
          Setter for property 'credentials'.
 void setEnableStatistics(boolean enableStatistics)
           
 void setJmxSupportFactory(JmxSupportFactory jmxSupportFactory)
          Setter for property 'jmxSupportFactory'.
 void setLocateServer(boolean locateServer)
           
 void setMBeanServer(javax.management.MBeanServer mBeanServer)
           
 void setName(String name)
          Sets the name of this agent
 void start()
           (non-Javadoc)
 void stop()
           (non-Javadoc)
 void unregistered()
           (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REMOTING_URI

public static final String DEFAULT_REMOTING_URI
See Also:
Constant Field Values

DEFAULT_CONNECTOR_SERVER_PROPERTIES

public static final Map DEFAULT_CONNECTOR_SERVER_PROPERTIES

DEFAULT_JMX_AUTHENTICATOR

public static final String DEFAULT_JMX_AUTHENTICATOR
Default JMX Authenticator to use for securing remote access.


logger

protected static final Log logger
Logger used by this class


locateServer

protected boolean locateServer
Should MBeanServer be discovered.

Constructor Detail

JmxAgent

public JmxAgent()
Default constructor.

Method Detail

getName

public String getName()
Gets the name of this agent

Specified by:
getName in interface UMOAgent
Returns:
the agent name
See Also:
UMOAgent.getName()

setName

public void setName(String name)
Sets the name of this agent

Specified by:
setName in interface UMOAgent
Parameters:
name - the name of the agent
See Also:
UMOAgent.setName(java.lang.String)

getDescription

public String getDescription()
Should be a 1 line description of the agent

Specified by:
getDescription in interface UMOAgent
Returns:
See Also:
UMOAgent.getDescription()

initialise

public void initialise()
                throws InitialisationException
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from
See Also:
Initialisable.initialise()

start

public void start()
           throws UMOException
(non-Javadoc)

Specified by:
start in interface Startable
Throws:
UMOException
See Also:
Startable.start()

stop

public void stop()
          throws UMOException
(non-Javadoc)

Specified by:
stop in interface Stoppable
Throws:
UMOException
See Also:
Stoppable.stop()

dispose

public void dispose()
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions. (non-Javadoc)

Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

registered

public void registered()
(non-Javadoc)

Specified by:
registered in interface UMOAgent
See Also:
UMOAgent.registered()

unregistered

public void unregistered()
(non-Javadoc)

Specified by:
unregistered in interface UMOAgent
See Also:
UMOAgent.unregistered()

registerWrapperService

protected void registerWrapperService()
                               throws UMOException
Register a Java Service Wrapper agent.

Throws:
UMOException - if registration failed

registerStatisticsService

protected void registerStatisticsService()
                                  throws javax.management.NotCompliantMBeanException,
                                         javax.management.MBeanRegistrationException,
                                         javax.management.InstanceAlreadyExistsException,
                                         javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerModelServices

protected void registerModelServices()
                              throws javax.management.NotCompliantMBeanException,
                                     javax.management.MBeanRegistrationException,
                                     javax.management.InstanceAlreadyExistsException,
                                     javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerMuleService

protected void registerMuleService()
                            throws javax.management.NotCompliantMBeanException,
                                   javax.management.MBeanRegistrationException,
                                   javax.management.InstanceAlreadyExistsException,
                                   javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerConfigurationService

protected void registerConfigurationService()
                                     throws javax.management.NotCompliantMBeanException,
                                            javax.management.MBeanRegistrationException,
                                            javax.management.InstanceAlreadyExistsException,
                                            javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerComponentServices

protected void registerComponentServices()
                                  throws javax.management.NotCompliantMBeanException,
                                         javax.management.MBeanRegistrationException,
                                         javax.management.InstanceAlreadyExistsException,
                                         javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerEndpointServices

protected void registerEndpointServices()
                                 throws javax.management.NotCompliantMBeanException,
                                        javax.management.MBeanRegistrationException,
                                        javax.management.InstanceAlreadyExistsException,
                                        javax.management.MalformedObjectNameException
Throws:
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
javax.management.MalformedObjectNameException

registerConnectorServices

protected void registerConnectorServices()
                                  throws javax.management.MalformedObjectNameException,
                                         javax.management.NotCompliantMBeanException,
                                         javax.management.MBeanRegistrationException,
                                         javax.management.InstanceAlreadyExistsException
Throws:
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException

isCreateServer

public boolean isCreateServer()
Returns:
Returns the createServer.

setCreateServer

public void setCreateServer(boolean createServer)
Parameters:
createServer - The createServer to set.

isLocateServer

public boolean isLocateServer()
Returns:
Returns the locateServer.

setLocateServer

public void setLocateServer(boolean locateServer)
Parameters:
locateServer - The locateServer to set.

getConnectorServerUrl

public String getConnectorServerUrl()
Returns:
Returns the connectorServerUrl.

setConnectorServerUrl

public void setConnectorServerUrl(String connectorServerUrl)
Parameters:
connectorServerUrl - The connectorServerUrl to set.

isEnableStatistics

public boolean isEnableStatistics()
Returns:
Returns the enableStatistics.

setEnableStatistics

public void setEnableStatistics(boolean enableStatistics)
Parameters:
enableStatistics - The enableStatistics to set.

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
Returns:
Returns the mBeanServer.

setMBeanServer

public void setMBeanServer(javax.management.MBeanServer mBeanServer)
Parameters:
mBeanServer - The mBeanServer to set.

getConnectorServerProperties

public Map getConnectorServerProperties()
Getter for property 'connectorServerProperties'.

Returns:
Value for property 'connectorServerProperties'.

setConnectorServerProperties

public void setConnectorServerProperties(Map connectorServerProperties)
Setter for property 'connectorServerProperties'. Set to null to use defaults (DEFAULT_CONNECTOR_SERVER_PROPERTIES). Pass in an empty map to use no parameters. Passing a non-empty map will replace defaults.

Parameters:
connectorServerProperties - Value to set for property 'connectorServerProperties'.

getJmxSupportFactory

public JmxSupportFactory getJmxSupportFactory()
Getter for property 'jmxSupportFactory'.

Returns:
Value for property 'jmxSupportFactory'.

setJmxSupportFactory

public void setJmxSupportFactory(JmxSupportFactory jmxSupportFactory)
Setter for property 'jmxSupportFactory'.

Parameters:
jmxSupportFactory - Value to set for property 'jmxSupportFactory'.

setCredentials

public void setCredentials(Map newCredentials)
Setter for property 'credentials'.

Parameters:
newCredentials - Value to set for property 'credentials'.


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.