org.apache.logging.log4j.core.net.server
Class AbstractSocketServer<T extends InputStream>

java.lang.Object
  extended by org.apache.logging.log4j.core.LogEventListener
      extended by org.apache.logging.log4j.core.net.server.AbstractSocketServer<T>
Type Parameters:
T - The kind of input stream read TODO Make a LifeCycle
All Implemented Interfaces:
Runnable, EventListener
Direct Known Subclasses:
TcpSocketServer, UdpSocketServer

public abstract class AbstractSocketServer<T extends InputStream>
extends LogEventListener
implements Runnable

Abstract socket server for TCP and UDP implementations.


Nested Class Summary
protected static class AbstractSocketServer.ServerConfigurationFactory
          Factory that creates a Configuration for the server.
 
Field Summary
protected  LogEventBridge<T> logEventInput
           
protected  org.apache.logging.log4j.Logger logger
           
protected static int MAX_PORT
           
 
Constructor Summary
AbstractSocketServer(int port, LogEventBridge<T> logEventInput)
          Creates a new socket server.
 
Method Summary
protected  boolean isActive()
           
protected  void setActive(boolean isActive)
           
 Thread startNewThread()
          Start this server in a new thread.
 
Methods inherited from class org.apache.logging.log4j.core.LogEventListener
log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

MAX_PORT

protected static final int MAX_PORT
See Also:
Constant Field Values

logEventInput

protected final LogEventBridge<T extends InputStream> logEventInput

logger

protected final org.apache.logging.log4j.Logger logger
Constructor Detail

AbstractSocketServer

public AbstractSocketServer(int port,
                            LogEventBridge<T> logEventInput)
Creates a new socket server.

Parameters:
port - listen to this port
logEventInput - Use this input to read log events.
Method Detail

isActive

protected boolean isActive()

setActive

protected void setActive(boolean isActive)

startNewThread

public Thread startNewThread()
Start this server in a new thread.

Returns:
the new thread that running this server.


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.