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).- Since:
- 2.5.2
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogLogger available to subclasses.Fields inherited from class NotificationListenerHolder
mappedObjectNames -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.voiddestroy()Unregisters the specifiedNotificationListener.AllowMapaccess to the environment to be set for the connector, with the option to add or override specific entries.voidprepare()Registers the specifiedNotificationListener.voidsetAgentId(String agentId) Set the agent id of theMBeanServerto locate.voidsetEnvironment(@Nullable Map<String, ?> environment) Specify the environment for the JMX connector.voidsetServer(MBeanServerConnection server) Set theMBeanServerConnectionused to connect to the MBean which all invocations are routed to.voidsetServiceUrl(String url) Set the service URL of the remoteMBeanServer.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerLogger available to subclasses.
-
-
Constructor Details
-
NotificationListenerRegistrar
public NotificationListenerRegistrar()
-
-
Method Details
-
setServer
Set theMBeanServerConnectionused to connect to the MBean which all invocations are routed to. -
setEnvironment
-
getEnvironment
AllowMapaccess 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 theMBeanServerto 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.- See Also:
-
afterPropertiesSet
public void afterPropertiesSet()Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
afterPropertiesSetin interfaceInitializingBean
-
prepare
public void prepare()Registers the specifiedNotificationListener.Ensures that an
MBeanServerConnectionis configured and attempts to detect a local connection if one is not supplied. -
destroy
public void destroy()Unregisters the specifiedNotificationListener.- Specified by:
destroyin interfaceDisposableBean
-