Package org.apache.nifi.io.socket
Class SocketListener
java.lang.Object
org.apache.nifi.io.socket.SocketListener
Implements a listener for TCP/IP messages sent over unicast socket.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ServerSocketConfiguration
private static final int
private ExecutorService
private static final org.slf4j.Logger
private final int
private final int
private ServerSocket
private final AtomicInteger
-
Constructor Summary
ConstructorDescriptionSocketListener
(int numThreads, int port, ServerSocketConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
dispatchRequest
(Socket socket) Implements the action to perform when a new socket request is received.int
getPort()
int
boolean
void
setShutdownListenerSeconds
(int shutdownListenerSeconds) void
start()
void
stop()
-
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
-
serverSocket
-
numThreads
private final int numThreads -
port
private final int port -
configuration
-
shutdownListenerSeconds
-
-
Constructor Details
-
SocketListener
-
-
Method Details
-
dispatchRequest
Implements the action to perform when a new socket request is received. This class will close the socket.- Parameters:
socket
- the socket
-
start
- Throws:
IOException
-
isRunning
public boolean isRunning() -
stop
- Throws:
IOException
-
getShutdownListenerSeconds
public int getShutdownListenerSeconds() -
setShutdownListenerSeconds
public void setShutdownListenerSeconds(int shutdownListenerSeconds) -
getConfiguration
-
getPort
public int getPort()
-