The Spring Framework

## 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`).

Requires JMX 1.2's `MBeanServerConnection` feature. As a consequence, this class will not work on JMX 1.0.

Since:
  2.5.2
Author:
  Juergen Hoeller
See Also:
  `setServer(javax.management.MBeanServerConnection)`, `NotificationListenerHolder.setMappedObjectNames(java.lang.Object[])`, `NotificationListenerHolder.setNotificationListener(javax.management.NotificationListener)`

Field Summary
`protected Log` `logger` Logger available to subclasses

Fields inherited from class org.springframework.jmx.support.NotificationListenerHolder
`mappedObjectNames`

Constructor Summary
`NotificationListenerRegistrar()`

Method Summary
`void` `afterPropertiesSet()` Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
`void` `destroy()` Unregisters the specified `NotificationListener`.
`void` `prepare()` Registers the specified `NotificationListener`.
`void` `setAgentId(String agentId)` Set the agent id of the `MBeanServer` to locate.
`void` `setServer(MBeanServerConnection server)` Set the `MBeanServerConnection` used to connect to the MBean which all invocations are routed to.
`void` `setServiceUrl(String url)` Set the service URL of the remote `MBeanServer`.

Methods inherited from class org.springframework.jmx.support.NotificationListenerHolder
`equals, getHandback, getNotificationFilter, getNotificationListener, getResolvedObjectNames, hashCode, setHandback, setMappedObjectName, setMappedObjectNames, setNotificationFilter, setNotificationListener`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected final Log logger

  Logger available to subclasses

Constructor Detail

### NotificationListenerRegistrar

    public NotificationListenerRegistrar()

Method Detail

### setServer

    public void setServer(MBeanServerConnection server)

  Set the `MBeanServerConnection` used to connect to the MBean which all invocations are routed to.

### setServiceUrl

    public void setServiceUrl(String url)
                       throws MalformedURLException

  Set the service URL of the remote `MBeanServer`.

  Throws:
    `MalformedURLException`

### setAgentId

    public void setAgentId(String agentId)

  Set the agent id of the `MBeanServer` 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.

  See Also:
    `MBeanServerFactory.findMBeanServer(String)`

### afterPropertiesSet

    public void afterPropertiesSet()

  Description copied from interface: `InitializingBean`
  Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

  This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

  Specified by:
    `afterPropertiesSet` in interface `InitializingBean`

### prepare

    public void prepare()

  Registers the specified `NotificationListener`.

  Ensures that an `MBeanServerConnection` is configured and attempts to detect a local connection if one is not supplied.

### destroy

    public void destroy()

  Unregisters the specified `NotificationListener`.

  Specified by:
    `destroy` in interface `DisposableBean`

The Spring Framework

Copyright © 2002-2008 The Spring Framework.