|
Java™ Platform Standard Ed. 7 DRAFT ea-b76 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
| 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 |
|---|
void receive(NotificationResult nr)
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.
nr - the received notifications and sequence numbers.void failed(Throwable t)
EventRelay to report when it receives an unexpected
exception, which may be fatal and which may make it stop receiving
notifications.
t - The unexpected exception received while EventRelay was running.void nonFatal(Exception e)
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.
e - The unexpected exception received while notifications are being received.
|
Java™ Platform Standard Ed. 7 DRAFT ea-b76 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.