Package org.springframework.jmx.access
Class NotificationListenerRegistrar
- java.lang.Object
- org.springframework.jmx.support.NotificationListenerHolder
- org.springframework.jmx.access.NotificationListenerRegistrar
- All Implemented Interfaces:
DisposableBean
,InitializingBean
public class NotificationListenerRegistrar extends NotificationListenerHolder implements InitializingBean, DisposableBean
Registrar object that associates a specificNotificationListener
with one or more MBeans in anMBeanServer
(typically via aMBeanServerConnection
).
Field Summary
Fields inherited from class org.springframework.jmx.support.NotificationListenerHolder
mappedObjectNames
Constructor Summary
Constructors Constructor Description NotificationListenerRegistrar()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
destroy()
Unregisters the specifiedNotificationListener
.Map<String,?>
getEnvironment()
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.void
prepare()
Registers the specifiedNotificationListener
.void
setAgentId(String agentId)
Set the agent id of theMBeanServer
to locate.void
setEnvironment(Map<String,?> environment)
Specify the environment for the JMX connector.void
setServer(MBeanServerConnection server)
Set theMBeanServerConnection
used to connect to the MBean which all invocations are routed to.void
setServiceUrl(String url)
Set the service URL of the remoteMBeanServer
.Methods inherited from class org.springframework.jmx.support.NotificationListenerHolder
equals, getHandback, getNotificationFilter, getNotificationListener, getResolvedObjectNames, hashCode, setHandback, setMappedObjectName, setMappedObjectNames, setNotificationFilter, setNotificationListener
Constructor Detail
NotificationListenerRegistrar
public NotificationListenerRegistrar()
Method Detail
setServer
public void setServer(MBeanServerConnection server)
Set theMBeanServerConnection
used to connect to the MBean which all invocations are routed to.
setEnvironment
public void setEnvironment(Map<String,?> environment)
Specify the environment for the JMX connector.
getEnvironment
public Map<String,?> getEnvironment()
Allow Map access to the environment to be set for the connector, with the option to add or override specific entries.Useful for specifying entries directly, for example via "environment[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.
setServiceUrl
public void setServiceUrl(String url) throws MalformedURLException
Set the service URL of the remoteMBeanServer
.- Throws:
MalformedURLException
setAgentId
public void setAgentId(String agentId)
Set the agent id of theMBeanServer
to locate.Default is none. If specified, this will result in an attempt being made to locate the attendant MBeanServer, unless the
"serviceUrl"
property has been set.
afterPropertiesSet
public void afterPropertiesSet()
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
prepare
public void prepare()
Registers the specifiedNotificationListener
.Ensures that an
MBeanServerConnection
is configured and attempts to detect a local connection if one is not supplied.
destroy
public void destroy()
Unregisters the specifiedNotificationListener
.- Specified by:
destroy
in interfaceDisposableBean