|Modifier||Constructor and Description|
Construct an instance with the given name.
|Modifier and Type||Method and Description|
Propagate the command line arguments.
Run a service.
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected AbstractLaunchableService(String name)
public Configuration bindArgs(Configuration config, List<String> args) throws Exception
This method is called before
Any non-null configuration that is returned from this operation
becomes the one that is passed on to that
This permits implementations to change the configuration before
the init operation. As the ServiceLauncher only creates
an instance of the base
Configuration class, it is
recommended to instantiate any subclass (such as YarnConfiguration)
that injects new resources.
The base implementation logs all arguments at the debug level, then returns the passed in config unchanged.
config- the initial configuration build up by the service launcher.
args- list of arguments passed to the command line after any launcher-specific commands have been stripped.
Exception- any problem
public int execute() throws Exception
The return value becomes the exit code of the launched process.
If an exception is raised, the policy is:
ExitUtil.ExitException: the exception is passed up unmodified.
ExitCodeProvider: A new
ServiceLaunchExceptionis created with the exit code and message of the thrown exception; the thrown exception becomes the cause.
ServiceLaunchExceptionis created with the exit code
LauncherExitCodes.EXIT_EXCEPTION_THROWNand the message of the original exception (which becomes the cause).
The action is to signal success by returning the exit code 0.
Copyright © 2019 Apache Software Foundation. All rights reserved.