TPTP 4.2.0 Platform Project
Public API Specification

org.eclipse.hyades.collection.correlation
Class ServiceRegistry

java.lang.Object
  extended byorg.eclipse.hyades.collection.correlation.Stack
      extended byorg.eclipse.hyades.collection.correlation.ServiceRegistry

public class ServiceRegistry
extends Stack

This is the application registry with which each application must register using a unique identifier. An application can be located in the registry, or deregistered from the registry using the same credential. The registry itself is a singleton, i.e., all applications within the same environment should be registered with the same registry.


Field Summary
 
Fields inherited from class org.eclipse.hyades.collection.correlation.Stack
increment, privateStorage, stack, top
 
Method Summary
 boolean deregisterApplication(IApplication application)
          Deregisters an application from the registry using the identifier returned by IApplication.getId().
 IApplication getApplicationById(int id)
          Locate an application using an identifier.
 IApplication[] getApplications()
          Returns the array of all applications registered.
static ServiceRegistry getRegistry()
          Gets a singleton registry.
 boolean registerApplication(IApplication application)
          Registers an application with the registry using the identifier returned by IApplication.getId().
 
Methods inherited from class org.eclipse.hyades.collection.correlation.Stack
peek, peek, pop, push
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRegistry

public static ServiceRegistry getRegistry()
Gets a singleton registry. If the registry has not been instantiated, a new instance will be created.

Returns:
a singleton application registry

getApplications

public IApplication[] getApplications()
Returns the array of all applications registered.

Returns:
the array of all applications registered.

getApplicationById

public IApplication getApplicationById(int id)
Locate an application using an identifier.

Parameters:
id - the identifier of the target application
Returns:
a reference to the application, or null if no such application is found.

registerApplication

public boolean registerApplication(IApplication application)
Registers an application with the registry using the identifier returned by IApplication.getId(). It is the responsibility of the applications to ensure that this ID does not conflict with other IDs. Consequently, an ID can be used to register at most once.

Parameters:
application - the application to be registered
Returns:
whether the application is registered or not.
See Also:
deregisterApplication(IApplication)

deregisterApplication

public boolean deregisterApplication(IApplication application)
Deregisters an application from the registry using the identifier returned by IApplication.getId().

Parameters:
application - the application to be deregistered
Returns:
whether the application is deregistered or not.
See Also:
registerApplication(IApplication)

TPTP 4.2.0 Platform Project
Public API Specification