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

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management.event
Interface EventReceiver


public interface EventReceiver

An object implementing this interface is passed by an EventClient to its EventRelay, to allow the EventRelay to communicate received notifications to the EventClient.

See Also:
Custom notification transports

Method Summary
Modifier and Type Method and Description
 void failed(Throwable t)
          Allows the EventRelay to report when it receives an unexpected exception, which may be fatal and which may make it stop receiving notifications.
 void nonFatal(Exception e)
          Allows the EventRelay to report when it receives an unexpected exception that is not fatal.
 void receive(NotificationResult nr)
          This method is implemented by EventClient as a callback to receive notifications from EventRelay.
 

Method Detail

receive

void receive(NotificationResult nr)
This method is implemented by EventClient as a callback to receive notifications from EventRelay.

The notifications are included in an object specified by the class NotificationResult. In addition to a set of notifications, the class object also contains two values: earliestSequenceNumber and nextSequenceNumber. These two values determine whether any notifications have been lost. The nextSequenceNumber value of the last time is compared to the received value earliestSequenceNumber. If the received earliesSequenceNumber is greater, than the difference signifies the number of lost notifications. A sender should ensure the sequence of notifications sent, meaning that the value earliestSequenceNumber of the next return should be always equal to or greater than the value nextSequenceNumber of the last return.

Parameters:
nr - the received notifications and sequence numbers.

failed

void failed(Throwable t)
Allows the EventRelay to report when it receives an unexpected exception, which may be fatal and which may make it stop receiving notifications.

Parameters:
t - The unexpected exception received while EventRelay was running.

nonFatal

void nonFatal(Exception e)
Allows the EventRelay to report when it receives an unexpected exception that is not fatal. For example, a notification received is not serializable or its class is not found.

Parameters:
e - The unexpected exception received while notifications are being received.

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.