Class DiscoveryService

java.lang.Object
org.openspaces.admin.internal.discovery.DiscoveryService
All Implemented Interfaces:
EventListener, DiscoveryListener, ServiceDiscoveryListener

public class DiscoveryService extends Object implements DiscoveryListener, ServiceDiscoveryListener
Author:
kimchy
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    addLocator(String locator)
     
    void
    Called when one or more lookup service registrars has been discarded.
    void
    Called when one or more lookup service registrars has been discovered.
    void
     
     
    static String
    Get the String value found in the JMXConnection entry, or null if the attribute set does not include a JMXConnection
     
    boolean
     
    void
    When the cache receives from one of the managed lookup services, an event signaling the registration of a service of interest for the first time (or for the first time since the service has been discarded), the cache invokes the serviceAdded method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discovered.
    void
    When the cache receives, from a managed lookup service, an event signaling the unique modification of the attributes of a service of interest (across the attribute sets of all references to the service), the cache invokes the serviceChanged method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that the state of a service of interest has changed.
    void
    When the cache receives, from a managed lookup service, an event signaling the removal of a service of interest from the last such lookup service with which it was registered, the cache invokes the serviceRemoved method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discarded.
    void
     
    void
     
    void
     
     
    toString(boolean verbose)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DiscoveryService

      public DiscoveryService(InternalAdmin admin)
  • Method Details

    • setDiscoveryServices

      public void setDiscoveryServices(Class... services)
    • addGroup

      public void addGroup(String group)
    • addLocator

      public void addLocator(String locator)
    • discoverUnmanagedSpaces

      public void discoverUnmanagedSpaces()
    • start

      public void start()
    • stop

      public void stop()
    • discovered

      public void discovered(DiscoveryEvent disEvent)
      Description copied from interface: DiscoveryListener
      Called when one or more lookup service registrars has been discovered. The method should return quickly; e.g., it should not make remote calls.
      Specified by:
      discovered in interface DiscoveryListener
      Parameters:
      disEvent - the event that describes the discovered registrars
    • discarded

      public void discarded(DiscoveryEvent e)
      Description copied from interface: DiscoveryListener
      Called when one or more lookup service registrars has been discarded. The method should return quickly; e.g., it should not make remote calls.
      Specified by:
      discarded in interface DiscoveryListener
      Parameters:
      e - the event that describes the discarded registrars
    • serviceAdded

      public void serviceAdded(ServiceDiscoveryEvent event)
      Description copied from interface: ServiceDiscoveryListener
      When the cache receives from one of the managed lookup services, an event signaling the registration of a service of interest for the first time (or for the first time since the service has been discarded), the cache invokes the serviceAdded method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discovered.
      Specified by:
      serviceAdded in interface ServiceDiscoveryListener
      Parameters:
      event - an instance of ServiceDiscoveryEvent containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.
    • getJMXConnection

      public static String getJMXConnection(Entry[] attrs)
      Get the String value found in the JMXConnection entry, or null if the attribute set does not include a JMXConnection
    • serviceRemoved

      public void serviceRemoved(ServiceDiscoveryEvent event)
      Description copied from interface: ServiceDiscoveryListener
      When the cache receives, from a managed lookup service, an event signaling the removal of a service of interest from the last such lookup service with which it was registered, the cache invokes the serviceRemoved method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that a service of interest has been discarded.
      Specified by:
      serviceRemoved in interface ServiceDiscoveryListener
      Parameters:
      event - a ServiceDiscoveryEvent object containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.
    • serviceChanged

      public void serviceChanged(ServiceDiscoveryEvent event)
      Description copied from interface: ServiceDiscoveryListener
      When the cache receives, from a managed lookup service, an event signaling the unique modification of the attributes of a service of interest (across the attribute sets of all references to the service), the cache invokes the serviceChanged method on all instances of ServiceDiscoveryListener that are registered with the cache; doing so notifies the entity that the state of a service of interest has changed.
      Specified by:
      serviceChanged in interface ServiceDiscoveryListener
      Parameters:
      event - a ServiceDiscoveryEvent object containing references to the service item corresponding to the event, including representations of the service's state both before and after the event.
    • getGroups

      public String[] getGroups()
    • getLocators

      public LookupLocator[] getLocators()
    • isDynamicLocatorsEnabled

      public boolean isDynamicLocatorsEnabled()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean verbose)