public abstract class ProcessCommandScriptHandler extends ExecutionScriptHandlerBase implements CommandScriptHandler
CommandScriptHandler
.
# <position> = 0, 1, 2, ...
# <prefix command token> can contain "@[position],"
# this will be replaced as original command tokens (0-origin position)
command.<profile-name> = <subclass class name>
command.<profile-name>.env.ASAKUSA_HOME = ${ASAKUSA_HOME}
command.<profile-name>.command.<position> = $<prefix command token>
command.<profile-name>.env.<key> = $<extra environment variables>
PROFILE_WILDCARD
DEFAULT_RESOURCE_ID, ENV_EXTENSION_PREFIX, KEY_ENV_PREFIX, KEY_PROP_PREFIX, KEY_RESOURCE
Constructor and Description |
---|
ProcessCommandScriptHandler() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(ExecutionMonitor monitor,
ExecutionContext context)
Cleanup the target environment.
|
protected abstract void |
configureExtension(ServiceProfile<?> profile)
Configures this handler internally (extension point).
|
protected void |
doConfigure(ServiceProfile<?> profile,
Map<String,String> desiredProperties,
Map<String,String> desiredEnvironmentVariables)
Configures this handler internally (extention point).
|
void |
execute(ExecutionMonitor monitor,
ExecutionContext context,
CommandScript script)
Executes the specified script.
|
protected abstract ProcessExecutor |
getCommandExecutor()
Returns command executor for this handler (extension point).
|
void |
setUp(ExecutionMonitor monitor,
ExecutionContext context)
Setup the target environment.
|
configure, getEnvironmentVariables, getHandlerId, getProperties, getResourceId, voidCleanUp, voidSetUp
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEnvironmentVariables, getHandlerId, getProperties, getResourceId
protected final void doConfigure(ServiceProfile<?> profile, Map<String,String> desiredProperties, Map<String,String> desiredEnvironmentVariables) throws InterruptedException, IOException
ExecutionScriptHandlerBase
doConfigure
in class ExecutionScriptHandlerBase
profile
- the profile of this servicedesiredProperties
- the current desired system/hadoop properties (configurable)desiredEnvironmentVariables
- the current desired environment variables (configurable)InterruptedException
- if interrupted in configurationIOException
- if failed to configure this serviceprotected abstract void configureExtension(ServiceProfile<?> profile) throws InterruptedException, IOException
profile
- the profile of this serviceInterruptedException
- if interrupted in configurationIOException
- if failed to configure this serviceprotected abstract ProcessExecutor getCommandExecutor()
public final void execute(ExecutionMonitor monitor, ExecutionContext context, CommandScript script) throws InterruptedException, IOException
ExecutionScriptHandler
execute
in interface ExecutionScriptHandler<CommandScript>
monitor
- the progress monitor of the executioncontext
- current execution contextscript
- target scriptInterruptedException
- if the execution was interruptedIOException
- if execution was failedpublic void setUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
ExecutionScriptHandlerBase
setUp
in interface ExecutionScriptHandler<CommandScript>
setUp
in class ExecutionScriptHandlerBase
monitor
- the progress monitor of the operationcontext
- the current execution contextInterruptedException
- if this operation is interruptedIOException
- if failed to setup the target environmentpublic void cleanUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
ExecutionScriptHandlerBase
cleanUp
in interface ExecutionScriptHandler<CommandScript>
cleanUp
in class ExecutionScriptHandlerBase
monitor
- the progress monitor of the operationcontext
- the current execution contextInterruptedException
- if this operation is interruptedIOException
- if failed to setup the target environmentCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.