Please note that this documentation is not final and is subject to change.

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management.event
Class ListenerInfo

java.lang.Object
  extended by javax.management.event.ListenerInfo

public class ListenerInfo
extends Object

This class specifies all the information required to register a user listener into a remote MBean server. This class is not serializable because a user listener is not serialized in order to be sent to the remote server.

Since:
JMX 2.0

Constructor Summary
Constructor and Description
ListenerInfo(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback, boolean isSubscription)
          Constructs a ListenerInfo object.
 
Method Summary
Modifier and Type Method and Description
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 NotificationFilter getFilter()
          Returns the listener filter.
 Object getHandback()
          Returns the listener handback.
 NotificationListener getListener()
          Returns the listener.
 ObjectName getObjectName()
          Returns an MBean or an MBean pattern that the listener listens to.
 int hashCode()
          Returns a hash code value for the object.
 boolean isSubscription()
          Returns true if this is a subscription listener.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListenerInfo

public ListenerInfo(ObjectName name,
                    NotificationListener listener,
                    NotificationFilter filter,
                    Object handback,
                    boolean isSubscription)
Constructs a ListenerInfo object.

Parameters:
name - The name of the MBean to which the listener should be added.
listener - The listener object which will handle the notifications emitted by the MBean.
filter - The filter object. If the filter is null, no filtering will be performed before notifications are handled.
handback - The context to be sent to the listener when a notification is emitted.
isSubscription - If true, the listener is subscribed via an EventManager. Otherwise it is added to a registered MBean.
Method Detail

getObjectName

public ObjectName getObjectName()
Returns an MBean or an MBean pattern that the listener listens to.

Returns:
An MBean or an MBean pattern.

getListener

public NotificationListener getListener()
Returns the listener.

Returns:
The listener.

getFilter

public NotificationFilter getFilter()
Returns the listener filter.

Returns:
The filter.

getHandback

public Object getHandback()
Returns the listener handback.

Returns:
The handback.

isSubscription

public boolean isSubscription()
Returns true if this is a subscription listener.

Returns:
True if this is a subscription listener.
See Also:
EventClient.addListeners(java.util.Collection)

equals

public boolean equals(Object o)

Indicates whether some other object is "equal to" this one. The return value is true if and only if o is an instance of ListenerInfo and has equal values for all of its properties.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), HashMap

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), System.identityHashCode(java.lang.Object)

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

Submit a bug or feature

Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.