Package ch.qos.logback.classic.net
Class SimpleSocketServer
- java.lang.Object
-
- java.lang.Thread
-
- ch.qos.logback.classic.net.SimpleSocketServer
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
SimpleSSLSocketServer
public class SimpleSocketServer extends Thread
A simpleSocketNodebased server.<b>Usage:</b> java ch.qos.logback.classic.net.SimpleSocketServer port configFilewhere port is a port number where the server listens and configFile is an xml configuration file fed toJoranConfigurator.- Since:
- 0.8.4
- Author:
- Ceki Gülcü, Sébastien Pennec
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description SimpleSocketServer(LoggerContext lc, int port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static voidconfigureLC(LoggerContext lc, String configFile)protected static voiddoMain(Class<? extends SimpleSocketServer> serverClass, String[] argv)protected StringgetClientThreadName(Socket socket)Returns a name to identify each client thread.CountDownLatchgetLatch()Used for testing purposesprotected ServerSocketFactorygetServerSocketFactory()Gets the platform defaultServerSocketFactory.protected StringgetServerThreadName()Returns the name given to the server thread.booleanisClosed()static voidmain(String[] argv)voidrun()voidsocketNodeClosing(SocketNode sn)-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
SimpleSocketServer
public SimpleSocketServer(LoggerContext lc, int port)
-
-
Method Detail
-
doMain
protected static void doMain(Class<? extends SimpleSocketServer> serverClass, String[] argv) throws Exception
- Throws:
Exception
-
getServerThreadName
protected String getServerThreadName()
Returns the name given to the server thread.
-
getClientThreadName
protected String getClientThreadName(Socket socket)
Returns a name to identify each client thread.
-
getServerSocketFactory
protected ServerSocketFactory getServerSocketFactory()
Gets the platform defaultServerSocketFactory.Subclasses may override to provide a custom server socket factory.
-
getLatch
public CountDownLatch getLatch()
Used for testing purposes
-
isClosed
public boolean isClosed()
-
close
public void close()
-
socketNodeClosing
public void socketNodeClosing(SocketNode sn)
-
configureLC
public static void configureLC(LoggerContext lc, String configFile) throws JoranException
- Throws:
JoranException
-
-