|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.mercury.EventLogFactory.EventLogIteratorImpl
private static class EventLogFactory.EventLogIteratorImpl
Private class which implements the EventLogIterator interface. This class delegates to an EventLog for most of its functionality.
Field Summary | |
---|---|
private EventLog |
log
The associated EventLog for this iterator |
private Uuid |
uuid
The associated Uuid for this iterator |
Constructor Summary | |
---|---|
EventLogFactory.EventLogIteratorImpl(Uuid id)
Simple constructor that assigns the Uuid field to the appropriate internal field and creates a transient event log. |
|
EventLogFactory.EventLogIteratorImpl(Uuid id,
File logPath)
Simple constructor that assigns the Uuid field to the appropriate internal field and creates a persistent EventLog object using the provided File argument. |
Method Summary | |
---|---|
void |
add(RemoteEvent evt)
Store the given RemoteEvent event. |
void |
destroy()
Destroy the collection of stored events. |
boolean |
hasNext()
Return true if there are any events in the collection and false otherwise. |
void |
init()
|
void |
moveAhead(Object cookie)
Effectively removes the last set of read events from the log. |
RemoteEvent |
next()
Return the next event in the collection. |
RemoteEventData[] |
readAhead(int maxEvents)
Return an array of RemoteEventData with a limit of maxEvents elements. |
void |
remove()
Remove the event at the iterator's current cursor position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Uuid uuid
private EventLog log
Constructor Detail |
---|
EventLogFactory.EventLogIteratorImpl(Uuid id, File logPath)
EventLogFactory.EventLogIteratorImpl(Uuid id)
Method Detail |
---|
public void init() throws IOException
IOException
public void add(RemoteEvent evt) throws IOException, IllegalArgumentException
EventLogIterator
add
in interface EventLogIterator
IOException
- if an I/O errors occurs
IllegalArgumentException
public boolean hasNext() throws IOException
EventLogIterator
hasNext
in interface EventLogIterator
IOException
- if an I/O errors occurspublic RemoteEvent next() throws IOException, ClassNotFoundException, NoSuchElementException
EventLogIterator
next
in interface EventLogIterator
IOException
- if an I/O errors occurs
ClassNotFoundException
- if there was a problem deserializing
the stored RemoteEvent
NoSuchElementException
- if there are no available
RemoteEvent
spublic void remove() throws IOException, IllegalStateException
EventLogIterator
remove
in interface EventLogIterator
IOException
- if an I/O errors occurs
IllegalStateException
public RemoteEventData[] readAhead(int maxEvents) throws IOException, ClassNotFoundException
EventLogIterator
readAhead
in interface EventLogIterator
maxEvents
- maximum number of events/elements to return
IOException
- if an I/O error occurs
ClassNotFoundException
- if a class for the serialized
object could not be foundpublic void moveAhead(Object cookie) throws IOException
EventLogIterator
moveAhead
in interface EventLogIterator
cookie
- object associated with event to read past. This object
should have been obtained from a previous call to readAhead
on this event log.
IOException
- if there was a problem advancing the read pointer.public void destroy() throws IOException
EventLogIterator
destroy
in interface EventLogIterator
IOException
- if an I/O errors occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |