Save This Page
Home » spring-framework-2.5.4 » org.springframework » jmx » support » [javadoc | source]
org.springframework.jmx.support
public class: MBeanServerFactoryBean [javadoc | source]
java.lang.Object
   org.springframework.jmx.support.MBeanServerFactoryBean

All Implemented Interfaces:
    DisposableBean, InitializingBean, FactoryBean

FactoryBean that obtains an javax.management.MBeanServer reference through the standard JMX 1.2 javax.management.MBeanServerFactory API (which is available on JDK 1.5 or as part of a JMX 1.2 provider). Exposes the MBeanServer for bean references.

By default, MBeanServerFactoryBean will always create a new MBeanServer even if one is already running. To have the MBeanServerFactoryBean attempt to locate a running MBeanServer first, set the value of the "locateExistingServerIfPossible" property to "true".

Field Summary
protected final  Log logger     
Method from org.springframework.jmx.support.MBeanServerFactoryBean Summary:
afterPropertiesSet,   createMBeanServer,   destroy,   getObject,   getObjectType,   isSingleton,   locateMBeanServer,   setAgentId,   setDefaultDomain,   setLocateExistingServerIfPossible,   setRegisterWithFactory
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.jmx.support.MBeanServerFactoryBean Detail:
 public  void afterPropertiesSet() throws MBeanServerNotFoundException 
    Creates the MBeanServer instance.
 protected MBeanServer createMBeanServer(String defaultDomain,
    boolean registerWithFactory) 
    Create a new MBeanServer instance and register it with the MBeanServerFactory, if desired.
 public  void destroy() 
    Unregisters the MBeanServer instance, if necessary.
 public Object getObject() 
 public Class getObjectType() 
 public boolean isSingleton() 
 protected MBeanServer locateMBeanServer(String agentId) throws MBeanServerNotFoundException 
    Attempt to locate an existing MBeanServer. Called if locateExistingServerIfPossible is set to true.

    The default implementation attempts to find an MBeanServer using a standard lookup. Subclasses may override to add additional location logic.

 public  void setAgentId(String agentId) 
    Set the agent id of the MBeanServer to locate.

    Default is none. If specified, this will result in an automatic attempt being made to locate the attendant MBeanServer, and (importantly) if said MBeanServer cannot be located no attempt will be made to create a new MBeanServer (and an MBeanServerNotFoundException will be thrown at resolution time).

 public  void setDefaultDomain(String defaultDomain) 
    Set the default domain to be used by the MBeanServer, to be passed to MBeanServerFactory.createMBeanServer() or MBeanServerFactory.findMBeanServer().

    Default is none.

 public  void setLocateExistingServerIfPossible(boolean locateExistingServerIfPossible) 
    Set whether or not the MBeanServerFactoryBean should attempt to locate a running MBeanServer before creating one.

    Default is false.

 public  void setRegisterWithFactory(boolean registerWithFactory) 
    Set whether to register the MBeanServer with the MBeanServerFactory, making it available through MBeanServerFactory.findMBeanServer().