Class AddingCompositeService

  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.service.CompositeService
          extended by
All Implemented Interfaces:
Closeable, Service

public class AddingCompositeService
extends 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

Field Summary
Fields inherited from class org.apache.hadoop.service.CompositeService
Constructor Summary
AddingCompositeService(String name)
Method Summary
 void addService(Service service)
          Add the passed Service to the list of services managed by this CompositeService
 boolean removeService(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 Detail


public AddingCompositeService(String name)
Method Detail


public void addService(Service service)
Description copied from class: CompositeService
Add the passed Service to the list of services managed by this CompositeService

addService in class CompositeService
service - the Service to be added


public boolean removeService(Service service)
removeService in class CompositeService

Copyright © 2014 Apache Software Foundation. All Rights Reserved.