Class SimpleSocketServer

  • All Implemented Interfaces:
    java.lang.Runnable
    Direct Known Subclasses:
    SimpleSSLSocketServer

    public class SimpleSocketServer
    extends java.lang.Thread
    A simple SocketNode based server.
          <b>Usage:</b> java ch.qos.logback.classic.net.SimpleSocketServer port configFile
     
    where port is a port number where the server listens and configFile is an xml configuration file fed to JoranConfigurator.
    Since:
    0.8.4
    Author:
    Ceki Gülcü, Sébastien Pennec
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      static void configureLC​(LoggerContext lc, java.lang.String configFile)  
      protected static void doMain​(java.lang.Class<? extends SimpleSocketServer> serverClass, java.lang.String[] argv)  
      protected java.lang.String getClientThreadName​(java.net.Socket socket)
      Returns a name to identify each client thread.
      java.util.concurrent.CountDownLatch getLatch()
      Used for testing purposes
      protected javax.net.ServerSocketFactory getServerSocketFactory()
      Gets the platform default ServerSocketFactory.
      protected java.lang.String getServerThreadName()
      Returns the name given to the server thread.
      boolean isClosed()  
      static void main​(java.lang.String[] argv)  
      void run()  
      void socketNodeClosing​(SocketNode sn)  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleSocketServer

        public SimpleSocketServer​(LoggerContext lc,
                                  int port)
    • Method Detail

      • main

        public static void main​(java.lang.String[] argv)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doMain

        protected static void doMain​(java.lang.Class<? extends SimpleSocketServer> serverClass,
                                     java.lang.String[] argv)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • getServerThreadName

        protected java.lang.String getServerThreadName()
        Returns the name given to the server thread.
      • getClientThreadName

        protected java.lang.String getClientThreadName​(java.net.Socket socket)
        Returns a name to identify each client thread.
      • getServerSocketFactory

        protected javax.net.ServerSocketFactory getServerSocketFactory()
        Gets the platform default ServerSocketFactory.

        Subclasses may override to provide a custom server socket factory.

      • getLatch

        public java.util.concurrent.CountDownLatch getLatch()
        Used for testing purposes
      • isClosed

        public boolean isClosed()
      • close

        public void close()
      • socketNodeClosing

        public void socketNodeClosing​(SocketNode sn)