public class MulticastProtocolListener extends MulticastListener implements ProtocolListener
| Modifier and Type | Field and Description |
|---|---|
private BulletinRepository |
bulletinRepository |
private Collection<ProtocolHandler> |
handlers |
private String |
listenerId |
private static org.slf4j.Logger |
logger |
private ProtocolContext<ProtocolMessage> |
protocolContext |
| Constructor and Description |
|---|
MulticastProtocolListener(int numThreads,
InetSocketAddress multicastAddress,
MulticastConfiguration configuration,
ProtocolContext<ProtocolMessage> protocolContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ProtocolHandler handler)
Registers a handler with the listener.
|
void |
dispatchRequest(MulticastSocket multicastSocket,
DatagramPacket packet) |
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, getMaxPacketSizeBytes, getMulticastAddress, getNumThreads, getShutdownListenerSeconds, isRunning, setMaxPacketSizeBytes, setShutdownListenerSecondsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRunningprivate static final org.slf4j.Logger logger
private final Collection<ProtocolHandler> handlers
private final String listenerId
private final ProtocolContext<ProtocolMessage> protocolContext
private volatile BulletinRepository bulletinRepository
public MulticastProtocolListener(int numThreads,
InetSocketAddress multicastAddress,
MulticastConfiguration configuration,
ProtocolContext<ProtocolMessage> protocolContext)
public void setBulletinRepository(BulletinRepository bulletinRepository)
ProtocolListenersetBulletinRepository in interface ProtocolListenerpublic void start()
throws IOException
ProtocolListenerstart in interface ProtocolListenerstart in class MulticastListenerIOExceptionpublic void stop()
throws IOException
ProtocolListenerstop in interface ProtocolListenerstop in class MulticastListenerIOExceptionpublic 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(MulticastSocket multicastSocket, DatagramPacket packet)
dispatchRequest in class MulticastListenerCopyright © 2015 Apache NiFi(incubating) Project. All rights reserved.