public class SocketNode13 extends ComponentBase implements Runnable, Pauseable
LoggingEvent
objects sent from a remote client using
Sockets (TCP). These logging events are logged according to local
policy, as if they were generated locally.
For example, the socket node might decide to log events to a local file and also resent them to a second socket node. Implementation lifted from org.apache.log4j.net.SocketNode in log4j 1.3 and renamed to prevent collision with log4j 1.2 implementation.
repository
Constructor and Description |
---|
SocketNode13(Socket s,
org.apache.log4j.spi.LoggerRepository hierarchy)
Constructor for socket and logger repository.
|
SocketNode13(Socket s,
Receiver r)
Constructor for socket and receiver.
|
Modifier and Type | Method and Description |
---|---|
void |
addSocketNodeEventListener(SocketNodeEventListener listener)
Adds the listener to the list of listeners to be notified of the
respective event.
|
void |
close()
Close the node and underlying socket
|
boolean |
isClosed()
Get if node is closed.
|
boolean |
isPaused()
Get if node is paused.
|
void |
removeSocketNodeEventListener(SocketNodeEventListener listener)
Removes the registered Listener from this instances list of
listeners.
|
void |
run()
Deserialize events from socket until interrupted.
|
void |
setListener(SocketNodeEventListener l)
Deprecated.
Now supports mutliple listeners, this method
simply invokes the removeSocketNodeEventListener() to remove
the listener, and then readds it.
|
void |
setPaused(boolean b)
Sets if node is paused.
|
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
public SocketNode13(Socket s, org.apache.log4j.spi.LoggerRepository hierarchy)
s
- sockethierarchy
- logger repositorypublic void setListener(SocketNodeEventListener l)
l
- listenerpublic void addSocketNodeEventListener(SocketNodeEventListener listener)
listener
- the listener to add to the listpublic void removeSocketNodeEventListener(SocketNodeEventListener listener)
listener
- the SocketNodeEventListener to removepublic void run()
public void setPaused(boolean b)
public boolean isPaused()
public void close() throws IOException
IOException
public boolean isClosed()
Copyright © 2002-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.