Interface ClusterSingletonServiceProvider

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractClusterSingletonServiceProviderImpl, DefaultClusterSingletonServiceProvider, DOMClusterSingletonServiceProviderImpl, OSGiClusterSingletonServiceProvider

public interface ClusterSingletonServiceProvider extends AutoCloseable
ClusterSingletonServiceProvider provides a functionality to register and group services ClusterSingletonService by service group identifier. Services could be Applications or RPCs. Provider provides a functionality which allows to have only one fully instantiated service instance in a cluster at one time and service group means to have all service instances for the same group situated on same Cluster Node. This is realized via a double candidate approach where a service group instance maintains a candidate registration for ownership of the service group entity in the cluster and also a registration that acts as a guard to ensure a service group instance has fully closed prior to relinquishing service group ownership. To achieve ownership of the service group, a service group candidate must hold ownership of both these entities.
  • Method Details

    • registerClusterSingletonService

      ClusterSingletonServiceRegistration registerClusterSingletonService(ClusterSingletonService service)
      Method registers ClusterSingletonService to Provider. Method returns RuntimeException for unexpected state, so be careful with implementation. Note: RuntimeException is implemented as a notification about some problems with registration and client has to implement some strategy for handling this issue. TODO: RuntimeException is not a transparent contract for handling unexpected state and it needs to be replaced with a specific documented Exception or it needs to add another contract definition for a client notification about the unexpected state reason in ClusterSingletonService. RuntimeException implementation is a hotfix for an unwanted API contract changes in boron release only.
      Parameters:
      service - ClusterSingletonService instance
      Returns:
      AutoCloseable registration