T - the target script kindpublic abstract class ExecutionScriptHandlerDispatcher<T extends ExecutionScript> extends Object implements ExecutionScriptHandler<T>
ExecutionScriptHandler.DEFAULT_RESOURCE_ID, ENV_EXTENSION_PREFIX, KEY_ENV_PREFIX, KEY_PROP_PREFIX, KEY_RESOURCE| Modifier | Constructor and Description |
|---|---|
protected |
ExecutionScriptHandlerDispatcher(Class<? extends ExecutionScriptHandler<T>> handlerKind)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp(ExecutionMonitor monitor,
ExecutionContext context)
Cleanup the target environment.
|
void |
configure(ServiceProfile<?> profile)
Configures this service.
|
void |
execute(ExecutionMonitor monitor,
ExecutionContext context,
T script)
Executes the specified script.
|
Map<String,String> |
getEnvironmentVariables(ExecutionContext context,
ExecutionScript script)
Returns desired environment variables to execute scripts using this handler.
|
String |
getHandlerId()
Returns the ID of this handler.
|
Map<String,String> |
getProperties(ExecutionContext context,
ExecutionScript script)
Returns desired system/hadoop properties to execute scripts using this handler.
|
String |
getResourceId(ExecutionContext context,
ExecutionScript script)
Returns the ID of a resource which is used for executing this handler.
|
void |
setUp(ExecutionMonitor monitor,
ExecutionContext context)
Setup the target environment.
|
protected ExecutionScriptHandlerDispatcher(Class<? extends ExecutionScriptHandler<T>> handlerKind)
handlerKind - the handler kindIllegalArgumentException - if some parameters were nullpublic void configure(ServiceProfile<?> profile) throws IOException, InterruptedException
Serviceconfigure in interface Serviceprofile - the profile of this serviceIOException - if failed to configure this serviceInterruptedException - if interrupted in configurationpublic String getHandlerId()
ExecutionScriptHandlergetHandlerId in interface ExecutionScriptHandler<T extends ExecutionScript>public String getResourceId(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
ExecutionScriptHandlergetResourceId in interface ExecutionScriptHandler<T extends ExecutionScript>context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentpublic Map<String,String> getProperties(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
ExecutionScriptHandlergetProperties in interface ExecutionScriptHandler<T extends ExecutionScript>context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentpublic Map<String,String> getEnvironmentVariables(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
ExecutionScriptHandlergetEnvironmentVariables in interface ExecutionScriptHandler<T extends ExecutionScript>context - the current execution contextscript - the target script (nullable)InterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentpublic void setUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
ExecutionScriptHandlersetUp in interface ExecutionScriptHandler<T extends ExecutionScript>monitor - the progress monitor of the operationcontext - the current execution contextInterruptedException - if this operation is interruptedIOException - if failed to setup the target environmentpublic void execute(ExecutionMonitor monitor, ExecutionContext context, T script) throws InterruptedException, IOException
ExecutionScriptHandlerexecute in interface ExecutionScriptHandler<T extends ExecutionScript>monitor - the progress monitor of the executioncontext - current execution contextscript - target scriptInterruptedException - if the execution was interruptedIOException - if execution was failedpublic void cleanUp(ExecutionMonitor monitor, ExecutionContext context) throws InterruptedException, IOException
ExecutionScriptHandlercleanUp in interface ExecutionScriptHandler<T extends ExecutionScript>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.