public class SocketProtocolListener extends SocketListener implements ProtocolListener
| Modifier and Type | Field and Description |
|---|---|
private BulletinRepository |
bulletinRepository |
private Collection<ProtocolHandler> |
handlers |
private static org.slf4j.Logger |
logger |
private ProtocolContext<ProtocolMessage> |
protocolContext |
| Constructor and Description |
|---|
SocketProtocolListener(int numThreads,
int port,
ServerSocketConfiguration configuration,
ProtocolContext<ProtocolMessage> protocolContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ProtocolHandler handler)
Registers a handler with the listener.
|
void |
dispatchRequest(Socket socket) |
Collection<ProtocolHandler> |
getHandlers() |
boolean |
removeHandler(ProtocolHandler handler)
Unregisters the handler with the listener.
|
void |
setBulletinRepository(BulletinRepository bulletinRepository)
Sets the BulletinRepository that can be used to report bulletins
|
void |
start()
Starts the instance for listening for messages.
|
void |
stop()
Stops the instance from listening for messages.
|
getConfiguration, getPort, getShutdownListenerSeconds, isRunning, setShutdownListenerSecondsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRunningprivate static final org.slf4j.Logger logger
private final ProtocolContext<ProtocolMessage> protocolContext
private final Collection<ProtocolHandler> handlers
private volatile BulletinRepository bulletinRepository
public SocketProtocolListener(int numThreads,
int port,
ServerSocketConfiguration configuration,
ProtocolContext<ProtocolMessage> protocolContext)
public void setBulletinRepository(BulletinRepository bulletinRepository)
ProtocolListenersetBulletinRepository in interface ProtocolListenerpublic void start()
throws IOException
ProtocolListenerstart in interface ProtocolListenerstart in class SocketListenerIOExceptionpublic void stop()
throws IOException
ProtocolListenerstop in interface ProtocolListenerstop in class SocketListenerIOExceptionpublic Collection<ProtocolHandler> getHandlers()
getHandlers in interface ProtocolListenerpublic void addHandler(ProtocolHandler handler)
ProtocolListeneraddHandler in interface ProtocolListenerhandler - a handlerpublic boolean removeHandler(ProtocolHandler handler)
ProtocolListenerremoveHandler in interface ProtocolListenerhandler - a handlerpublic void dispatchRequest(Socket socket)
dispatchRequest in class SocketListenerCopyright © 2015 Apache NiFi(incubating) Project. All rights reserved.