Class DiscoveryGroup
java.lang.Object
org.apache.activemq.artemis.core.cluster.DiscoveryGroup
- All Implemented Interfaces:
ActiveMQComponent
This class is used to search for members on the cluster through the opaque interface
BroadcastEndpoint.
There are two current implementations, and that's probably all we will ever need.
We will probably keep both interfaces for a while as UDP is a simple solution requiring no extra dependencies which is suitable for users looking for embedded solutions.
-
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryGroup(String nodeID, String name, long timeout, long stoppingTimeout, BroadcastEndpointFactory endpointFactory, NotificationService service) This is the main constructor, intended to be used -
Method Summary
Modifier and TypeMethodDescriptiongetName()voidThis will start the DiscoveryRunnable and run it directly.booleanvoidregisterListener(DiscoveryListener listener) voidstart()voidstop()voidunregisterListener(DiscoveryListener listener) booleanwaitForBroadcast(long timeout) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Constructor Details
-
DiscoveryGroup
public DiscoveryGroup(String nodeID, String name, long timeout, long stoppingTimeout, BroadcastEndpointFactory endpointFactory, NotificationService service) throws Exception This is the main constructor, intended to be used- Throws:
Exception
-
-
Method Details
-
start
- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
internalRunning
This will start the DiscoveryRunnable and run it directly. This is useful for a test process where we need this execution blocking a thread.- Throws:
Exception
-
stop
public void stop()- Specified by:
stopin interfaceActiveMQComponent
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceActiveMQComponent
-
getName
-
getDiscoveryEntries
-
waitForBroadcast
public boolean waitForBroadcast(long timeout) -
registerListener
-
unregisterListener
-