interface EventLog
| Modifier and Type | Method and Description |
|---|---|
void |
add(RemoteEvent event)
Writes the given RemoteEvent to the underlying
storage mechanism, if possible.
|
void |
close()
Close this log and release any associated runtime resources.
|
void |
delete()
Delete associated storage resources for this log.
|
void |
init()
Initializes the state of this EventLog object.
|
boolean |
isEmpty()
Returns true if this log contains no events and
false otherwise.
|
void |
moveAhead(Object cookie)
Effectively removes the last set of read events from the log.
|
RemoteEvent |
next()
Return the next RemoteEvent to be read.
|
RemoteEventData[] |
readAhead(int maxEvents)
Return an array of RemoteEventData with a limit of
maxEvents elements.
|
void |
remove()
Effectively removes the last read event from the log.
|
void init() throws IOException
IOException - if an I/O error occursvoid add(RemoteEvent event) throws IOException
IOException - if an I/O error occursRemoteEvent next() throws IOException, ClassNotFoundException
IOException - if an I/O error occursClassNotFoundException - if a class for the serialized
object could not be foundNoSuchElementException - if no event is availableboolean isEmpty()
throws IOException
IOExceptionvoid remove()
throws IOException
NoSuchElementException - if no events are availableIOExceptionRemoteEventData[] readAhead(int maxEvents) throws IOException, ClassNotFoundException
maxEvents - maximum number of events/elements to returnIOException - if an I/O error occursClassNotFoundException - if a class for the serialized
object could not be foundNoSuchElementException - if no event is availablevoid moveAhead(Object cookie) throws IOException
cookie - object associated with event to read past. This object
should have been obtained from a call to
getCookie() on a RemoteEventData object
obtained from a call to readAhead on this event log.IOException - if there was a problem advancing the read pointer.NullPointerException - if cookie is null.ClassCastException - if cookie
is not an expected type.void close()
throws IOException
IOExceptionvoid delete()
throws IOException
IOException - if an IO error occursCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.