Class NotificationResult
java.lang.Object
javax.management.remote.NotificationResult
- All Implemented Interfaces:
Serializable
Result of a query for buffered notifications. Notifications in a notification buffer have positive, monotonically increasing sequence numbers. The result of a notification query contains the following elements:
- The sequence number of the earliest notification still in the buffer.
- The sequence number of the next notification available for querying. This will be the starting sequence number for the next notification query.
- An array of (Notification,listenerID) pairs corresponding to the returned notifications and the listeners they correspond to.
It is possible for the nextSequenceNumber
to be less
than the earliestSequenceNumber
. This signifies that
notifications between the two might have been lost.
- Since:
- 1.5
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationResult
(long earliestSequenceNumber, long nextSequenceNumber, TargetedNotification[] targetedNotifications) Constructs a notification query result. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the sequence number of the earliest notification still in the buffer.long
Returns the sequence number of the next notification available for querying.Returns the notifications resulting from the query, and the listeners they correspond to.toString()
Returns a string representation of the object.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
NotificationResult
public NotificationResult(long earliestSequenceNumber, long nextSequenceNumber, TargetedNotification[] targetedNotifications) Constructs a notification query result.
- Parameters:
earliestSequenceNumber
- the sequence number of the earliest notification still in the buffer.nextSequenceNumber
- the sequence number of the next notification available for querying.targetedNotifications
- the notifications resulting from the query, and the listeners they correspond to. This array can be empty.- Throws:
IllegalArgumentException
- iftargetedNotifications
is null or ifearliestSequenceNumber
ornextSequenceNumber
is negative.
-
-
Method Details
-
getEarliestSequenceNumber
public long getEarliestSequenceNumber()Returns the sequence number of the earliest notification still in the buffer.- Returns:
- the sequence number of the earliest notification still in the buffer.
-
getNextSequenceNumber
public long getNextSequenceNumber()Returns the sequence number of the next notification available for querying.- Returns:
- the sequence number of the next notification available for querying.
-
getTargetedNotifications
Returns the notifications resulting from the query, and the listeners they correspond to.- Returns:
- the notifications resulting from the query, and the listeners they correspond to. This array can be empty.
-
toString
-