class RemoteEventIteratorImpl extends Object implements RemoteEventIterator
Modifier and Type | Class and Description |
---|---|
private static class |
RemoteEventIteratorImpl.LocalRemoteEventData |
Modifier and Type | Field and Description |
---|---|
private boolean |
invalidated
Boolean flag indicating the (in)validity of this object.
|
private Object |
invalidatedLock
lock object protecting
invalidated flag. |
private Iterator |
iter
Event iterator
|
(package private) Uuid |
iteratorID
Unique identifier for this registration
|
private Object |
lastEventCookie
Last remote event cookie
|
(package private) MailboxBackEnd |
mailbox
Reference to service implementation
|
(package private) Uuid |
registrationID
Unique identifier for this registration
|
Constructor and Description |
---|
RemoteEventIteratorImpl(Uuid id,
Uuid regId,
MailboxBackEnd srv,
Collection evts)
Convenience constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
checkState()
Utility method that checks the validity of this object
and throws an exception if it's invalid.
|
void |
close()
Ends all event processing being performed by this iterator
and invalidates the iterator.
|
private RemoteEventIteratorImpl.LocalRemoteEventData |
getNextValidLocalRemoteEventData(Iterator i) |
private void |
invalidate()
Utility method that marks this object as invalid.
|
RemoteEvent |
next(long timeout)
Retrieves stored event notifications, if any.
|
final Uuid registrationID
final Uuid iteratorID
final MailboxBackEnd mailbox
private Iterator iter
private Object lastEventCookie
private Object invalidatedLock
invalidated
flag.private boolean invalidated
RemoteEventIteratorImpl(Uuid id, Uuid regId, MailboxBackEnd srv, Collection evts)
public RemoteEvent next(long timeout) throws RemoteException, InvalidIteratorException
RemoteEventIterator
next
in interface RemoteEventIterator
timeout
- the maximum time, in milliseconds, the event mailbox
service should wait for the receipt of an event notification
associated with this iterator's registration.RemoteEvent
RemoteException
- if there is
a communication failure between the client and the service.InvalidIteratorException
- if called on an invalidated iterator.private RemoteEventIteratorImpl.LocalRemoteEventData getNextValidLocalRemoteEventData(Iterator i)
public void close() throws InvalidIteratorException
RemoteEventIterator
close
in interface RemoteEventIterator
InvalidIteratorException
- if called on an invalidated iterator.private void checkState() throws InvalidIteratorException
InvalidIteratorException
private void invalidate()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.