Class SocketListener

java.lang.Object
org.apache.nifi.io.socket.SocketListener

public abstract class SocketListener extends Object
Implements a listener for TCP/IP messages sent over unicast socket.
  • Field Details

    • DEFAULT_SHUTDOWN_LISTENER_SECONDS

      private static final int DEFAULT_SHUTDOWN_LISTENER_SECONDS
      See Also:
    • logger

      private static final org.slf4j.Logger logger
    • executorService

      private volatile ExecutorService executorService
    • serverSocket

      private volatile ServerSocket serverSocket
    • numThreads

      private final int numThreads
    • port

      private final int port
    • configuration

      private final ServerSocketConfiguration configuration
    • shutdownListenerSeconds

      private final AtomicInteger shutdownListenerSeconds
  • Constructor Details

  • Method Details

    • dispatchRequest

      public abstract void dispatchRequest(Socket socket)
      Implements the action to perform when a new socket request is received. This class will close the socket.
      Parameters:
      socket - the socket
    • start

      public void start() throws IOException
      Throws:
      IOException
    • isRunning

      public boolean isRunning()
    • stop

      public void stop() throws IOException
      Throws:
      IOException
    • getShutdownListenerSeconds

      public int getShutdownListenerSeconds()
    • setShutdownListenerSeconds

      public void setShutdownListenerSeconds(int shutdownListenerSeconds)
    • getConfiguration

      public ServerSocketConfiguration getConfiguration()
    • getPort

      public int getPort()