FileDocCategorySizeDatePackage
TargetedNotification.javaAPI DocJava SE 5 API3742Fri Aug 26 14:57:38 BST 2005javax.management.remote

TargetedNotification

public class TargetedNotification extends Object implements Serializable

A (Notification, Listener ID) pair.

This class is used to associate an emitted notification with the listener ID to which it is targeted.

since
1.5
since.unbundled
1.0

Fields Summary
private static final long
serialVersionUID
private final Notification
notif
private final Integer
id
Constructors Summary
public TargetedNotification(Notification notification, Integer listenerID)

Constructs a TargetedNotification object. The object contains a pair (Notification, Listener ID). The Listener ID identifies the client listener to which that notification is targeted. The client listener ID is one previously returned by the connector server in response to an addNotificationListener request.

param
notification Notification emitted from the MBean server.
param
listenerID The ID of the listener to which this notification is targeted.
exception
IllegalArgumentException if the listenerID or notification is null.


// If we replace Integer with int...
//     /**
//      * <p>Constructs a <code>TargetedNotification</code> object.  The
//      * object contains a pair (Notification, Listener ID).
//      * The Listener ID identifies the client listener to which that
//      * notification is targeted. The client listener ID is one
//      * previously returned by the connector server in response to an
//      * <code>addNotificationListener</code> request.</p>
//      * @param notification Notification emitted from the MBean server.
//      * @param listenerID   The ID of the listener to which this
//      *        notification is targeted.
//      */
//     public TargetedNotification(Notification notification, 
// 				int listenerID) {
// 	this.notif = notification;
// 	this.id = listenerID;
//     }

                                                                                                    
       
				  
	// If we replace integer with int...
	// this(notification,intValue(listenerID));
 	if (notification == null) throw new 
 	    IllegalArgumentException("Invalid notification: null");
 	if (listenerID == null) throw new 
 	    IllegalArgumentException("Invalid listener ID: null");
 	this.notif = notification;
 	this.id = listenerID;
    
Methods Summary
public java.lang.IntegergetListenerID()

The ID of the listener to which the notification is targeted.

return
The listener ID.

	return id;
    
public javax.management.NotificationgetNotification()

The emitted notification.

return
The notification.

	return notif;
    
public java.lang.StringtoString()
Returns a textual representation of this Targeted Notification.

return
a String representation of this Targeted Notification.

	return "{" + notif + ", " + id + "}";