public class WorkflowSequenceService extends org.apache.hadoop.service.AbstractService implements ServiceParent, org.apache.hadoop.service.ServiceStateChangeListener
WorkflowSequenceService instance is
initialized, it only initializes itself.WorkflowSequenceService instance is
started, it initializes then starts the first of its children.
If there are no children, it immediately stops.| Constructor and Description |
|---|
WorkflowSequenceService()
Construct an instance with the default name
|
WorkflowSequenceService(String name)
Construct an instance
|
WorkflowSequenceService(String name,
List<org.apache.hadoop.service.Service> children)
Create a service sequence with the given list of services
|
WorkflowSequenceService(String name,
org.apache.hadoop.service.Service... children)
Create a service sequence with the given list of services
|
| Modifier and Type | Method and Description |
|---|---|
void |
addService(org.apache.hadoop.service.Service service)
Add the passed
Service to the list of services managed by this
WorkflowSequenceService |
org.apache.hadoop.service.Service |
getActiveService()
Get the current service -which may be null
|
org.apache.hadoop.service.Service |
getPreviousService()
Get the previously active service
|
List<org.apache.hadoop.service.Service> |
getServices()
Get an unmodifiable list of services
|
protected void |
onServiceCompleted(org.apache.hadoop.service.Service service)
handler for service completion: base class starts the next service
|
protected void |
serviceStart()
When started
|
protected void |
serviceStop() |
protected void |
setStopIfNoChildServicesAtStartup(boolean stopIfNoChildServicesAtStartup) |
boolean |
startNextService()
Start the next service in the list.
|
void |
stateChanged(org.apache.hadoop.service.Service service)
State change event relays service stop events to
onServiceCompleted(Service). |
String |
toString() |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic WorkflowSequenceService(String name)
name - service namepublic WorkflowSequenceService()
public WorkflowSequenceService(String name, org.apache.hadoop.service.Service... children)
name - service namechildren - initial sequencepublic org.apache.hadoop.service.Service getActiveService()
public org.apache.hadoop.service.Service getPreviousService()
protected void setStopIfNoChildServicesAtStartup(boolean stopIfNoChildServicesAtStartup)
protected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionpublic boolean startNextService()
RuntimeException - from any init or start failureorg.apache.hadoop.service.ServiceStateException - if this call is made before
the service is startedpublic void stateChanged(org.apache.hadoop.service.Service service)
onServiceCompleted(Service). Subclasses can
extend that with extra logicstateChanged in interface org.apache.hadoop.service.ServiceStateChangeListenerservice - the service that has changed.protected void onServiceCompleted(org.apache.hadoop.service.Service service)
service - service that has completedpublic void addService(org.apache.hadoop.service.Service service)
Service to the list of services managed by this
WorkflowSequenceServiceaddService in interface ServiceParentservice - the Service to be addedpublic List<org.apache.hadoop.service.Service> getServices()
getServices in interface ServiceParentpublic String toString()
toString in class org.apache.hadoop.service.AbstractServiceCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.