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_WILDCARDDEFAULT_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, voidSetUpclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEnvironmentVariables, getHandlerId, getProperties, getResourceIdprotected final void doConfigure(ServiceProfile<?> profile, Map<String,String> desiredProperties, Map<String,String> desiredEnvironmentVariables) throws InterruptedException, IOException
ExecutionScriptHandlerBasedoConfigure in class ExecutionScriptHandlerBaseprofile - 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
ExecutionScriptHandlerexecute 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
ExecutionScriptHandlerBasesetUp in interface ExecutionScriptHandler<CommandScript>setUp in class ExecutionScriptHandlerBasemonitor - 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
ExecutionScriptHandlerBasecleanUp in interface ExecutionScriptHandler<CommandScript>cleanUp in class ExecutionScriptHandlerBasemonitor - 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.