|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jfw.status.LogViewerObserver
public class LogViewerObserver
Is the observer of class JFWLogger. Every time a log
message send at JFWLogger this message is also send at they obervers.
You can use this an instance of the class in two ways:
stayInLoop(): this is the right method if you want to
stay in log and get all the log messages.
LogViewerObserver logViewerObserver = new LogViewerObserver(outputStream);
logViewerObserver.stayInLoop();
start() that add the instance as observer of
JFWLogger and when you want to stop to get the log messages
call the method stop().
LogViewerObserver logViewerObserver = new LogViewerObserver(outputStream);
logViewerObserver.start();
....
//we can continue with other thinks since the start method not block the
//execution
....
logViewerObserver.stop();
| Field Summary | |
|---|---|
static byte[] |
endMessage
The ending message. |
static byte[] |
messageSuffix
The suffix added ad every single message. |
static byte[] |
startMessage
The starting message. |
| Constructor Summary | |
|---|---|
LogViewerObserver(java.io.OutputStream outputStream)
Create an instance. |
|
| Method Summary | |
|---|---|
void |
finalize()
Call the super.finalize() method and the the method stop(). |
boolean |
observationStopped()
Return the value of attribute stopObservation. |
void |
start()
Add this instance as observer of JFWLogger. |
void |
stayInLoop()
Create a loop observing the attribute stopObservation. |
void |
stop()
Change the value of stopObservation in true and call the
method close(). |
void |
update(java.util.Observable observable,
java.lang.Object object)
Is called by the observable instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] messageSuffix
public static final byte[] startMessage
start() method.
public static final byte[] endMessage
close() method.
| Constructor Detail |
|---|
public LogViewerObserver(java.io.OutputStream outputStream)
outputStream - the stream where the log messages are written.| Method Detail |
|---|
public void stayInLoop()
stopObservation. Attribute
stopObservation change value in methods write2Stream(byte[]),
update(Observable, Object) and stop().
public void update(java.util.Observable observable,
java.lang.Object object)
stop() method is called.
update in interface java.util.Observerobservable - the observable instance.object - the log message.public void start()
JFWLogger.outputStream the starting message.
public void stop()
stopObservation in true and call the
method close().
public boolean observationStopped()
stopObservation.
stopObservation.
public void finalize()
throws java.lang.Throwable
stop().
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||