org.apache.activemq.transport.discovery.simple
Class SimpleDiscoveryAgent

java.lang.Object
  extended by 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
SimpleDiscoveryAgent()
           
 
Method Summary
 long getBackOffMultiplier()
           
 long getInitialReconnectDelay()
           
 int getMaxReconnectAttempts()
           
 long getMaxReconnectDelay()
           
 long getMinConnectTime()
           
 String[] getServices()
           
 boolean isUseExponentialBackOff()
           
 void registerService(String name)
          register a service
 void 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 listener
 void 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDiscoveryAgent

public SimpleDiscoveryAgent()
Method Detail

setDiscoveryListener

public void setDiscoveryListener(DiscoveryListener listener)
Description copied from interface: DiscoveryAgent
Sets the discovery listener

Specified by:
setDiscoveryListener in interface DiscoveryAgent

registerService

public void registerService(String name)
                     throws IOException
Description copied from interface: DiscoveryAgent
register a service

Specified by:
registerService in interface DiscoveryAgent
Throws:
IOException

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
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 interface DiscoveryAgent
Throws:
IOException

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)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.