|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcmsc433.p1.SplitLog
public class SplitLog
A SplitLog operates on two child logs. This class should be thread-safe.
| Constructor Summary | |
|---|---|
SplitLog(Log log1,
Log log2)
Creates a new SplitLog. |
|
| Method Summary | |
|---|---|
void |
add(LogRecord record)
Adds a record to both child logs. |
java.util.List<LogRecord> |
flush()
Calls flush on both child logs, returning a combined result. |
java.util.List<LogRecord> |
getAll(long windowMS)
Calls getAll on both child logs, returning a combined result. |
void |
register(Listener<LogRecord> listener)
Registers a listener that whose notify() method will be called whenever a record is added to this log; the first argument of notify() is the log itself, and the second is the LogRecord that was added. |
void |
unregister(Listener<LogRecord> listener)
Removes a previously-registered listener. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SplitLog(Log log1,
Log log2)
log1 - The first log to copy events to.log2 - The second log to copy events to.| Method Detail |
|---|
public void add(LogRecord record)
add in interface Logrecord - record to be added to both child logspublic java.util.List<LogRecord> getAll(long windowMS)
getAll in interface LogwindowMS - return all records from the last [windowMS]
milliseconds.public java.util.List<LogRecord> flush()
flush in interface Logpublic void register(Listener<LogRecord> listener)
Log
register in interface Loglistener - The listener to register.public void unregister(Listener<LogRecord> listener)
Log
unregister in interface Loglistener - The listener to remove. If this listener is
not present, then unregister behaves as a no-op.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||