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 Details

    • SimpleDiscoveryAgent

      public SimpleDiscoveryAgent()
  • Method Details

    • 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
    • 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)