public class ClusterServiceDiscovery extends Object implements MulticastServiceDiscovery, ProtocolListener
| Modifier and Type | Class and Description |
|---|---|
private class |
ClusterServiceDiscovery.ClusterManagerServiceBroadcastHandler |
| Modifier and Type | Field and Description |
|---|---|
private BulletinRepository |
bulletinRepository |
private MulticastProtocolListener |
listener |
private static org.slf4j.Logger |
logger |
private MulticastConfiguration |
multicastConfiguration |
private DiscoverableService |
service |
private String |
serviceName |
| Constructor and Description |
|---|
ClusterServiceDiscovery(String serviceName,
InetSocketAddress multicastAddress,
MulticastConfiguration multicastConfiguration,
ProtocolContext<ProtocolMessage> protocolContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ProtocolHandler handler)
Registers a handler with the listener.
|
Collection<ProtocolHandler> |
getHandlers() |
InetSocketAddress |
getMulticastAddress() |
MulticastConfiguration |
getMulticastConfiguration() |
DiscoverableService |
getService() |
String |
getServiceName() |
boolean |
isRunning() |
private String |
prettyPrint(InetSocketAddress address) |
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.
|
private static final org.slf4j.Logger logger
private final String serviceName
private final MulticastConfiguration multicastConfiguration
private final MulticastProtocolListener listener
private volatile BulletinRepository bulletinRepository
private DiscoverableService service
public ClusterServiceDiscovery(String serviceName, InetSocketAddress multicastAddress, MulticastConfiguration multicastConfiguration, ProtocolContext<ProtocolMessage> protocolContext)
public void setBulletinRepository(BulletinRepository bulletinRepository)
ProtocolListenersetBulletinRepository in interface ProtocolListenerbulletinRepository - repopublic DiscoverableService getService()
getService in interface ServiceDiscoverypublic InetSocketAddress getMulticastAddress()
getMulticastAddress in interface MulticastServiceDiscoverypublic 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 boolean isRunning()
isRunning in interface ProtocolListenerpublic void start()
throws IOException
ProtocolListenerstart in interface ProtocolListenerIOException - expublic void stop()
throws IOException
ProtocolListenerstop in interface ProtocolListenerIOException - expublic String getServiceName()
public MulticastConfiguration getMulticastConfiguration()
private String prettyPrint(InetSocketAddress address)
Copyright © 2015 Apache NiFi(incubating) Project. All rights reserved.