类 MBeanServerFactoryBean
- 所有已实现的接口:
DisposableBean,FactoryBean<MBeanServer>,InitializingBean
FactoryBean that obtains a MBeanServer reference
through the standard JMX 1.2 MBeanServerFactory
API.
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".
- 从以下版本开始:
- 4.0
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
-
字段概要
字段从接口继承的字段 cn.taketoday.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidCreates theMBeanServerinstance.protected MBeanServercreateMBeanServer(String defaultDomain, boolean registerWithFactory) Create a newMBeanServerinstance and register it with theMBeanServerFactory, if desired.voiddestroy()Unregisters theMBeanServerinstance, if necessary.Class<? extends MBeanServer>booleanprotected MBeanServerlocateMBeanServer(String agentId) Attempt to locate an existingMBeanServer.voidsetAgentId(String agentId) Set the agent id of theMBeanServerto locate.voidsetDefaultDomain(String defaultDomain) Set the default domain to be used by theMBeanServer, to be passed toMBeanServerFactory.createMBeanServer()orMBeanServerFactory.findMBeanServer().voidsetLocateExistingServerIfPossible(boolean locateExistingServerIfPossible) Set whether or not theMBeanServerFactoryBeanshould attempt to locate a runningMBeanServerbefore creating one.voidsetRegisterWithFactory(boolean registerWithFactory) Set whether to register theMBeanServerwith theMBeanServerFactory, making it available throughMBeanServerFactory.findMBeanServer().
-
字段详细资料
-
logger
protected final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
MBeanServerFactoryBean
public MBeanServerFactoryBean()
-
-
方法详细资料
-
setLocateExistingServerIfPossible
public void setLocateExistingServerIfPossible(boolean locateExistingServerIfPossible) Set whether or not theMBeanServerFactoryBeanshould attempt to locate a runningMBeanServerbefore creating one.Default is
false. -
setAgentId
Set the agent id of theMBeanServerto 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).
Specifying the empty String indicates the platform MBeanServer.
-
setDefaultDomain
Set the default domain to be used by theMBeanServer, to be passed toMBeanServerFactory.createMBeanServer()orMBeanServerFactory.findMBeanServer().Default is none.
-
setRegisterWithFactory
public void setRegisterWithFactory(boolean registerWithFactory) Set whether to register theMBeanServerwith theMBeanServerFactory, making it available throughMBeanServerFactory.findMBeanServer().Default is
true. -
afterPropertiesSet
Creates theMBeanServerinstance.- 指定者:
afterPropertiesSet在接口中InitializingBean- 抛出:
MBeanServerNotFoundException
-
locateMBeanServer
protected MBeanServer locateMBeanServer(@Nullable String agentId) throws MBeanServerNotFoundException Attempt to locate an existingMBeanServer. Called iflocateExistingServerIfPossibleis set totrue.The default implementation attempts to find an
MBeanServerusing a standard lookup. Subclasses may override to add additional location logic.- 参数:
agentId- the agent identifier of the MBeanServer to retrieve. If this parameter isnull, all registered MBeanServers are considered.- 返回:
- the
MBeanServerif found - 抛出:
MBeanServerNotFoundException- if noMBeanServercould be found- 另请参阅:
-
createMBeanServer
protected MBeanServer createMBeanServer(@Nullable String defaultDomain, boolean registerWithFactory) Create a newMBeanServerinstance and register it with theMBeanServerFactory, if desired.- 参数:
defaultDomain- the default domain, ornullif noneregisterWithFactory- whether to register theMBeanServerwith theMBeanServerFactory- 另请参阅:
-
getObject
- 指定者:
getObject在接口中FactoryBean<MBeanServer>
-
getObjectType
- 指定者:
getObjectType在接口中FactoryBean<MBeanServer>
-
isSingleton
public boolean isSingleton()- 指定者:
isSingleton在接口中FactoryBean<MBeanServer>
-
destroy
public void destroy()Unregisters theMBeanServerinstance, if necessary.- 指定者:
destroy在接口中DisposableBean
-