Class DiscoveryGroup
- java.lang.Object
-
- org.apache.activemq.artemis.core.cluster.DiscoveryGroup
-
- All Implemented Interfaces:
ActiveMQComponent
public final class DiscoveryGroup extends Object implements ActiveMQComponent
This class is used to search for members on the cluster through the opaque interfaceBroadcastEndpoint. 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
Constructors Constructor Description DiscoveryGroup(String nodeID, String name, long timeout, BroadcastEndpointFactory endpointFactory, NotificationService service)This is the main constructor, intended to be used
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DiscoveryEntry>getDiscoveryEntries()StringgetName()voidinternalRunning()This will start the DiscoveryRunnable and run it directly.booleanisStarted()voidregisterListener(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, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
-
-
-
Constructor Detail
-
DiscoveryGroup
public DiscoveryGroup(String nodeID, String name, long timeout, BroadcastEndpointFactory endpointFactory, NotificationService service) throws Exception
This is the main constructor, intended to be used- Parameters:
nodeID-name-timeout-endpointFactory-service-- Throws:
Exception
-
-
Method Detail
-
start
public void start() throws Exception- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
internalRunning
public void internalRunning() throws ExceptionThis 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
public String getName()
-
getDiscoveryEntries
public List<DiscoveryEntry> getDiscoveryEntries()
-
waitForBroadcast
public boolean waitForBroadcast(long timeout)
-
registerListener
public void registerListener(DiscoveryListener listener)
-
unregisterListener
public void unregisterListener(DiscoveryListener listener)
-
-