Log4j 1.3alpha-6

org.apache.log4j.net
Class SocketNode

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.net.SocketNode
All Implemented Interfaces:
Component, Pauseable, java.lang.Runnable

public class SocketNode
extends ComponentBase
implements java.lang.Runnable, Pauseable

Read 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.

Since:
0.8.4
Author:
Ceki Gülcü, Paul Smith

Field Summary
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
SocketNode(java.net.Socket socket, LoggerRepository hierarchy)
          Constructor for socket and logger repository.
SocketNode(java.net.Socket socket, Receiver receiver)
          Constructor for socket and reciever.
 
Method Summary
 void addSocketNodeEventListener(SocketNodeEventListener listener)
          Adds the listener to the list of listeners to be notified of the respective event
 boolean isPaused()
           
 void removeSocketNodeEventListener(SocketNodeEventListener listener)
          Removes the registered Listener from this instances list of listeners.
 void run()
           
 void setListener(SocketNodeEventListener _listener)
          Deprecated. Now supports mutliple listeners, this method simply invokes the removeSocketNodeEventListener() to remove the listener, and then readds it.
 void setPaused(boolean paused)
           
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, setLoggerRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketNode

public SocketNode(java.net.Socket socket,
                  LoggerRepository hierarchy)
Constructor for socket and logger repository.


SocketNode

public SocketNode(java.net.Socket socket,
                  Receiver receiver)
Constructor for socket and reciever.

Method Detail

setListener

public void setListener(SocketNodeEventListener _listener)
Deprecated. Now supports mutliple listeners, this method simply invokes the removeSocketNodeEventListener() to remove the listener, and then readds it.

Set the event listener on this node.


addSocketNodeEventListener

public void addSocketNodeEventListener(SocketNodeEventListener listener)
Adds the listener to the list of listeners to be notified of the respective event

Parameters:
listener - the listener to add to the list

removeSocketNodeEventListener

public void removeSocketNodeEventListener(SocketNodeEventListener listener)
Removes the registered Listener from this instances list of listeners. If the listener has not been registered, then invoking this method has no effect.

Parameters:
listener - the SocketNodeEventListener to remove

run

public void run()
Specified by:
run in interface java.lang.Runnable

setPaused

public void setPaused(boolean paused)
Specified by:
setPaused in interface Pauseable

isPaused

public boolean isPaused()
Specified by:
isPaused in interface Pauseable

Log4j 1.3alpha-6

Copyright 2000-2005 Apache Software Foundation.