T - The kind of input stream readpublic class TcpSocketServer<T extends InputStream> extends AbstractSocketServer<T>
main(String[])| Modifier and Type | Class and Description |
|---|---|
protected static class |
TcpSocketServer.CommandLineArguments |
AbstractSocketServer.ServerConfigurationFactorylogEventInput, logger, MAX_PORTLOGGER| Constructor and Description |
|---|
TcpSocketServer(int port,
int backlog,
InetAddress localBindAddress,
LogEventBridge<T> logEventInput)
Constructor.
|
TcpSocketServer(int port,
LogEventBridge<T> logEventInput)
Constructor.
|
TcpSocketServer(int port,
LogEventBridge<T> logEventInput,
ServerSocket serverSocket)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static TcpSocketServer<InputStream> |
createJsonSocketServer(int port)
Creates a socket server that reads JSON log events.
|
static TcpSocketServer<ObjectInputStream> |
createSerializedSocketServer(int port)
Creates a socket server that reads serialized log events.
|
static TcpSocketServer<ObjectInputStream> |
createSerializedSocketServer(int port,
int backlog,
InetAddress localBindAddress)
Creates a socket server that reads serialized log events.
|
static TcpSocketServer<ObjectInputStream> |
createSerializedSocketServer(int port,
int backlog,
InetAddress localBindAddress,
List<String> allowedClasses)
Creates a socket server that reads serialized log events.
|
static TcpSocketServer<InputStream> |
createXmlSocketServer(int port)
Creates a socket server that reads XML log events.
|
static void |
main(String[] args)
Main startup for the server.
|
void |
run()
Accept incoming events and processes them.
|
void |
shutdown()
Shutdown the server.
|
awaitTermination, isActive, setActive, startNewThreadlogpublic TcpSocketServer(int port,
int backlog,
InetAddress localBindAddress,
LogEventBridge<T> logEventInput)
throws IOException
port - The server socket port.backlog - The server socket backlog.localBindAddress - TODOlogEventInput - the log even inputIOException - if an I/O error occurs when opening the socket.public TcpSocketServer(int port,
LogEventBridge<T> logEventInput)
throws IOException
port - to listen.logEventInput - the log even inputIOException - if an I/O error occurs when opening the socket.public TcpSocketServer(int port,
LogEventBridge<T> logEventInput,
ServerSocket serverSocket)
throws IOException
port - to listen.logEventInput - the log even inputserverSocket - the socket serverIOException - if an I/O error occurs when opening the socket.public static TcpSocketServer<InputStream> createJsonSocketServer(int port) throws IOException
port - the port to listenIOException - if an I/O error occurs when opening the socket.public static TcpSocketServer<ObjectInputStream> createSerializedSocketServer(int port) throws IOException
port - the port to listenIOException - if an I/O error occurs when opening the socket.public static TcpSocketServer<ObjectInputStream> createSerializedSocketServer(int port, int backlog, InetAddress localBindAddress) throws IOException
port - the port to listenlocalBindAddress - The server socket's local bin addressIOException - if an I/O error occurs when opening the socket.public static TcpSocketServer<ObjectInputStream> createSerializedSocketServer(int port, int backlog, InetAddress localBindAddress, List<String> allowedClasses) throws IOException
port - the port to listenlocalBindAddress - The server socket's local bin addressallowedClasses - additional class names to allow for deserializationIOException - if an I/O error occurs when opening the socket.public static TcpSocketServer<InputStream> createXmlSocketServer(int port) throws IOException
port - the port to listenIOException - if an I/O error occurs when opening the socket.public static void main(String[] args) throws Exception
args - The command line arguments.Exception - if an error occurs.public void run()
public void shutdown()
throws IOException
shutdown in class AbstractSocketServer<T extends InputStream>IOException - if the server socket could not be closedCopyright © 1999-2017. 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.