com.bitfactoryinc.logging
Class LogSocketReader
java.lang.Object
|
+--com.bitfactoryinc.logging.LogSocketReader
- public class LogSocketReader
- extends java.lang.Object
- implements java.lang.Runnable
An instance of this class will read LogEntries from a Socket,
and subsequently log the LogEntries to it's logger.
Instances are typically created via the static method startListening(aPort,aLogSocketReaderReceiver).
|
Constructor Summary |
LogSocketReader(java.net.Socket aSocket)
The best way to create instances of this class is to use the static method StartListening |
LogSocketReader(java.net.Socket aSocket,
Logger aLogger)
The best way to create instances of this class is to use the static method StartListening |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
socket
private java.net.Socket socket
logger
private Logger logger
thread
private java.lang.Thread thread
LogSocketReader
public LogSocketReader(java.net.Socket aSocket)
- The best way to create instances of this class is to use the static method StartListening
LogSocketReader
public LogSocketReader(java.net.Socket aSocket,
Logger aLogger)
- The best way to create instances of this class is to use the static method StartListening
getHostName
public java.lang.String getHostName()
getLogger
public Logger getLogger()
getPort
public int getPort()
getSocket
protected java.net.Socket getSocket()
getThread
protected java.lang.Thread getThread()
processLogEntry
protected void processLogEntry(LogEntry aLogEntry)
readerClosed
protected void readerClosed()
run
public void run()
- Specified by:
- run in interface java.lang.Runnable
setLogger
public void setLogger(Logger newLogger)
setSocket
protected void setSocket(java.net.Socket newSocket)
setThread
protected void setThread(java.lang.Thread newThread)
start
public void start()
startListening
public static LogSocketReader.Listener startListening(int aPort,
LogSocketReaderReceiver aReceiver)
- Return a Listener. If listening needs to be stopped, send the stop() message to the Listener
stop
public void stop()