Class AddingCompositeService

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.registry.server.services.AddingCompositeService
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service

@Public @Evolving public class AddingCompositeService extends org.apache.hadoop.service.CompositeService
Composite service that exports the add/remove methods.

This allows external classes to add services to these methods, after which they follow the same lifecyce.

It is essential that any service added is in a state where it can be moved on with that of the parent services. Specifically, do not add an uninited service to a parent that is already inited —as the start operation will then fail

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService

    org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE
  • Field Summary

    Fields inherited from class org.apache.hadoop.service.CompositeService

    STOP_ONLY_STARTED_SERVICES
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addService(org.apache.hadoop.service.Service service)
     
    boolean
    removeService(org.apache.hadoop.service.Service service)
     

    Methods inherited from class org.apache.hadoop.service.CompositeService

    addIfService, getServices, serviceInit, serviceStart, serviceStop

    Methods inherited from class org.apache.hadoop.service.AbstractService

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop

    Methods inherited from class java.lang.Object

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

    • AddingCompositeService

      public AddingCompositeService(String name)
  • Method Details

    • addService

      public void addService(org.apache.hadoop.service.Service service)
      Overrides:
      addService in class org.apache.hadoop.service.CompositeService
    • removeService

      public boolean removeService(org.apache.hadoop.service.Service service)
      Overrides:
      removeService in class org.apache.hadoop.service.CompositeService