Class SimpleDiscoveryAgent
java.lang.Object
org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent
- All Implemented Interfaces:
Service
,DiscoveryAgent
- Direct Known Subclasses:
MasterSlaveDiscoveryAgent
A simple DiscoveryAgent that allows static configuration of the discovered
services.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doReconnectDelay
(org.apache.activemq.transport.discovery.simple.SimpleDiscoveryAgent.SimpleDiscoveryEvent event) long
long
int
long
long
String[]
boolean
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()
-
Constructor Details
-
SimpleDiscoveryAgent
public SimpleDiscoveryAgent()
-
-
Method Details
-
setDiscoveryListener
Description copied from interface:DiscoveryAgent
Sets the discovery listener- Specified by:
setDiscoveryListener
in interfaceDiscoveryAgent
-
registerService
Description copied from interface:DiscoveryAgent
register a service- Specified by:
registerService
in interfaceDiscoveryAgent
- Throws:
IOException
-
start
-
stop
-
getServices
-
setServices
-
setServices
-
setServices
-
serviceFailed
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)
-