Package org.springframework.jmx.support
Class MBeanServerConnectionFactoryBean
java.lang.Object
org.springframework.jmx.support.MBeanServerConnectionFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<MBeanServerConnection>
,org.springframework.beans.factory.InitializingBean
public class MBeanServerConnectionFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<MBeanServerConnection>, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
FactoryBean
that creates a JMX 1.2 MBeanServerConnection
to a remote MBeanServer
exposed via a JMXServerConnector
.
Exposes the MBeanServer
for bean references.- Since:
- 1.2
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates aJMXConnector
for the given settings and exposes the associatedMBeanServerConnection
.void
destroy()
Closes the underlyingJMXConnector
.Class<? extends MBeanServerConnection>
boolean
void
setBeanClassLoader
(ClassLoader classLoader) void
setConnectOnStartup
(boolean connectOnStartup) Set whether to connect to the server on startup.void
setEnvironment
(Properties environment) Set the environment properties used to construct theJMXConnector
asjava.util.Properties
(String key/value pairs).void
setEnvironmentMap
(Map<String, ?> environment) Set the environment properties used to construct theJMXConnector
as aMap
of String keys and arbitrary Object values.void
setServiceUrl
(String url) Set the service URL of the remoteMBeanServer
.
-
Constructor Details
-
MBeanServerConnectionFactoryBean
public MBeanServerConnectionFactoryBean()
-
-
Method Details
-
setServiceUrl
Set the service URL of the remoteMBeanServer
.- Throws:
MalformedURLException
-
setEnvironment
Set the environment properties used to construct theJMXConnector
asjava.util.Properties
(String key/value pairs). -
setEnvironmentMap
Set the environment properties used to construct theJMXConnector
as aMap
of String keys and arbitrary Object values. -
setConnectOnStartup
public void setConnectOnStartup(boolean connectOnStartup) Set whether to connect to the server on startup.Default is
true
.Can be turned off to allow for late start of the JMX server. In this case, the JMX connector will be fetched on first access.
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
afterPropertiesSet
Creates aJMXConnector
for the given settings and exposes the associatedMBeanServerConnection
.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
IOException
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<MBeanServerConnection>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<MBeanServerConnection>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<MBeanServerConnection>
-
destroy
Closes the underlyingJMXConnector
.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
IOException
-