Spring Framework

org.springframework.jmx.support
Class NotificationListenerHolder

java.lang.Object
  extended by org.springframework.jmx.support.NotificationListenerHolder
Direct Known Subclasses:
NotificationListenerBean, NotificationListenerRegistrar

public class NotificationListenerHolder
extends java.lang.Object

Helper class that aggregates a NotificationListener, a NotificationFilter, and an arbitrary handback object, as well as the names of MBeans from which the listener wishes to receive Notifications.

Since:
2.5.2
Author:
Juergen Hoeller
See Also:
NotificationListenerBean, NotificationListenerRegistrar

Field Summary
protected  java.util.Set<java.lang.Object> mappedObjectNames
           
 
Constructor Summary
NotificationListenerHolder()
           
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.Object getHandback()
          Return the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
 javax.management.NotificationFilter getNotificationFilter()
          Return the NotificationFilter associated with the encapsulated NotificationFilter.
 javax.management.NotificationListener getNotificationListener()
          Get the NotificationListener.
 javax.management.ObjectName[] getResolvedObjectNames()
          Return the list of ObjectName String representations for which the encapsulated NotificationFilter will be registered as a listener for Notifications.
 int hashCode()
           
 void setHandback(java.lang.Object handback)
          Set the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.
 void setMappedObjectName(java.lang.Object mappedObjectName)
          Set the ObjectName-style name of the single MBean that the encapsulated NotificationFilter will be registered with to listen for Notifications.
 void setMappedObjectNames(java.lang.Object[] mappedObjectNames)
          Set an array of ObjectName-style names of the MBeans that the encapsulated NotificationFilter will be registered with to listen for Notifications.
 void setNotificationFilter(javax.management.NotificationFilter notificationFilter)
          Set the NotificationFilter associated with the encapsulated NotificationFilter.
 void setNotificationListener(javax.management.NotificationListener notificationListener)
          Set the NotificationListener.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mappedObjectNames

protected java.util.Set<java.lang.Object> mappedObjectNames
Constructor Detail

NotificationListenerHolder

public NotificationListenerHolder()
Method Detail

setNotificationListener

public void setNotificationListener(javax.management.NotificationListener notificationListener)
Set the NotificationListener.


getNotificationListener

public javax.management.NotificationListener getNotificationListener()
Get the NotificationListener.


setNotificationFilter

public void setNotificationFilter(javax.management.NotificationFilter notificationFilter)
Set the NotificationFilter associated with the encapsulated NotificationFilter.

May be null.


getNotificationFilter

public javax.management.NotificationFilter getNotificationFilter()
Return the NotificationFilter associated with the encapsulated NotificationFilter.

May be null.


setHandback

public void setHandback(java.lang.Object handback)
Set the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.

Parameters:
handback - the handback object (can be null)
See Also:
NotificationListener.handleNotification(javax.management.Notification, Object)

getHandback

public java.lang.Object getHandback()
Return the (arbitrary) object that will be 'handed back' as-is by an NotificationBroadcaster when notifying any NotificationListener.

Returns:
the handback object (may be null)
See Also:
NotificationListener.handleNotification(javax.management.Notification, Object)

setMappedObjectName

public void setMappedObjectName(java.lang.Object mappedObjectName)
Set the ObjectName-style name of the single MBean that the encapsulated NotificationFilter will be registered with to listen for Notifications. Can be specified as ObjectName instance or as String.

See Also:
setMappedObjectNames(java.lang.Object[])

setMappedObjectNames

public void setMappedObjectNames(java.lang.Object[] mappedObjectNames)
Set an array of ObjectName-style names of the MBeans that the encapsulated NotificationFilter will be registered with to listen for Notifications. Can be specified as ObjectName instances or as Strings.

See Also:
setMappedObjectName(java.lang.Object)

getResolvedObjectNames

public javax.management.ObjectName[] getResolvedObjectNames()
                                                     throws javax.management.MalformedObjectNameException
Return the list of ObjectName String representations for which the encapsulated NotificationFilter will be registered as a listener for Notifications.

Throws:
javax.management.MalformedObjectNameException - if an ObjectName is malformed

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Spring Framework