org.apache.log4j.net
クラス SocketNode13

java.lang.Object
  上位を拡張 org.apache.log4j.spi.ComponentBase
      上位を拡張 org.apache.log4j.net.SocketNode13
すべての実装されたインタフェース:
java.lang.Runnable, org.apache.log4j.plugins.Pauseable, org.apache.log4j.spi.Component

public class SocketNode13
extends org.apache.log4j.spi.ComponentBase
implements java.lang.Runnable, org.apache.log4j.plugins.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. Implementation lifted from org.apache.log4j.net.SocketNode in log4j 1.3 and renamed to prevent collision with log4j 1.2 implementation.

作成者:
Ceki Gülcü, Paul Smith (psmith@apache.org)

フィールドの概要
 
クラス org.apache.log4j.spi.ComponentBase から継承されたフィールド
repository
 
コンストラクタの概要
SocketNode13(java.net.Socket s, org.apache.log4j.spi.LoggerRepository hierarchy)
          Constructor for socket and logger repository.
SocketNode13(java.net.Socket s, org.apache.log4j.plugins.Receiver r)
          Constructor for socket and receiver.
 
メソッドの概要
 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)
          推奨されていません。 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.
 
クラス org.apache.log4j.spi.ComponentBase から継承されたメソッド
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

SocketNode13

public SocketNode13(java.net.Socket s,
                    org.apache.log4j.spi.LoggerRepository hierarchy)
Constructor for socket and logger repository.

パラメータ:
s - socket
hierarchy - logger repository

SocketNode13

public SocketNode13(java.net.Socket s,
                    org.apache.log4j.plugins.Receiver r)
Constructor for socket and receiver.

パラメータ:
s - socket
r - receiver
メソッドの詳細

setListener

public void setListener(SocketNodeEventListener l)
推奨されていません。 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.

パラメータ:
l - listener

addSocketNodeEventListener

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

パラメータ:
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.

パラメータ:
listener - the SocketNodeEventListener to remove

run

public void run()
Deserialize events from socket until interrupted.

定義:
インタフェース java.lang.Runnable 内の run

setPaused

public void setPaused(boolean b)
Sets if node is paused.

定義:
インタフェース org.apache.log4j.plugins.Pauseable 内の setPaused
パラメータ:
b - new value

isPaused

public boolean isPaused()
Get if node is paused.

定義:
インタフェース org.apache.log4j.plugins.Pauseable 内の isPaused
戻り値:
true if pause.

close

public void close()
           throws java.io.IOException
Close the node and underlying socket

例外:
java.io.IOException

isClosed

public boolean isClosed()
Get if node is closed.

戻り値:
true if closed.


Copyright © 2010 Apache Software Foundation. All Rights Reserved.