Class SimpleDiscoveryAgent
- java.lang.Object
-
- org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent
-
- All Implemented Interfaces:
Service
,DiscoveryAgent
- Direct Known Subclasses:
MasterSlaveDiscoveryAgent
public class SimpleDiscoveryAgent extends Object implements DiscoveryAgent
A simple DiscoveryAgent that allows static configuration of the discovered services.
-
-
Constructor Summary
Constructors Constructor Description SimpleDiscoveryAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doReconnectDelay(org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.SimpleDiscoveryEvent event)
long
getBackOffMultiplier()
long
getInitialReconnectDelay()
int
getMaxReconnectAttempts()
long
getMaxReconnectDelay()
long
getMinConnectTime()
String[]
getServices()
boolean
isUseExponentialBackOff()
void
registerService(String name)
register a servicevoid
serviceFailed(DiscoveryEvent devent)
A process actively using a service may see it go down before the DiscoveryAgent notices the service's failure.void
setBackOffMultiplier(long backOffMultiplier)
void
setDiscoveryListener(DiscoveryListener listener)
Sets the discovery listenervoid
setInitialReconnectDelay(long initialReconnectDelay)
void
setMaxReconnectAttempts(int maxReconnectAttempts)
void
setMaxReconnectDelay(long maxReconnectDelay)
void
setMinConnectTime(long minConnectTime)
void
setServices(String services)
void
setServices(String[] services)
void
setServices(URI[] services)
void
setUseExponentialBackOff(boolean useExponentialBackOff)
void
start()
void
stop()
-
-
-
Method Detail
-
setDiscoveryListener
public void setDiscoveryListener(DiscoveryListener listener)
Description copied from interface:DiscoveryAgent
Sets the discovery listener- Specified by:
setDiscoveryListener
in interfaceDiscoveryAgent
-
registerService
public void registerService(String name) throws IOException
Description copied from interface:DiscoveryAgent
register a service- Specified by:
registerService
in interfaceDiscoveryAgent
- Throws:
IOException
-
start
public void start() throws Exception
-
getServices
public String[] getServices()
-
setServices
public void setServices(String services)
-
setServices
public void setServices(String[] services)
-
setServices
public void setServices(URI[] services)
-
serviceFailed
public void serviceFailed(DiscoveryEvent devent) throws IOException
Description copied from interface:DiscoveryAgent
A process actively using a service may see it go down before the DiscoveryAgent notices the service's failure. That process can use this method to notify the DiscoveryAgent of the failure so that other listeners of this DiscoveryAgent can also be made aware of the failure.- Specified by:
serviceFailed
in interfaceDiscoveryAgent
- Throws:
IOException
-
doReconnectDelay
protected void doReconnectDelay(org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.SimpleDiscoveryEvent event)
-
getBackOffMultiplier
public long getBackOffMultiplier()
-
setBackOffMultiplier
public void setBackOffMultiplier(long backOffMultiplier)
-
getInitialReconnectDelay
public long getInitialReconnectDelay()
-
setInitialReconnectDelay
public void setInitialReconnectDelay(long initialReconnectDelay)
-
getMaxReconnectAttempts
public int getMaxReconnectAttempts()
-
setMaxReconnectAttempts
public void setMaxReconnectAttempts(int maxReconnectAttempts)
-
getMaxReconnectDelay
public long getMaxReconnectDelay()
-
setMaxReconnectDelay
public void setMaxReconnectDelay(long maxReconnectDelay)
-
getMinConnectTime
public long getMinConnectTime()
-
setMinConnectTime
public void setMinConnectTime(long minConnectTime)
-
isUseExponentialBackOff
public boolean isUseExponentialBackOff()
-
setUseExponentialBackOff
public void setUseExponentialBackOff(boolean useExponentialBackOff)
-
-