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 specific
NotificationListener
with one or more MBeans in an MBeanServer
(typically via a MBeanServerConnection
).-
Field Summary
Fields inherited from class org.springframework.jmx.support.NotificationListenerHolder
mappedObjectNames
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
destroy()
Unregisters the specifiedNotificationListener
.AllowMap
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
-
Field Details
-
logger
Logger available to subclasses.
-
-
Constructor Details
-
NotificationListenerRegistrar
public NotificationListenerRegistrar()
-
-
Method Details
-
setServer
Set theMBeanServerConnection
used to connect to the MBean which all invocations are routed to. -
setEnvironment
Specify the environment for the JMX connector. -
getEnvironment
AllowMap
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
Set the service URL of the remoteMBeanServer
.- Throws:
MalformedURLException
-
setAgentId
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
-