public abstract class ExecutionScriptHandlerBase extends Object implements Service
ExecutionScriptHandler
.
Note that this class does not implement ExecutionScriptHandler
,
so that subclasses must implement HadoopScriptHandler
or CommandScriptHandler
.Constructor and Description |
---|
ExecutionScriptHandlerBase() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(ExecutionMonitor monitor,
ExecutionContext context)
Cleanup the target environment.
|
void |
configure(ServiceProfile<?> profile)
Configures this service.
|
protected abstract void |
doConfigure(ServiceProfile<?> profile,
Map<String,String> desiredProperties,
Map<String,String> desiredEnvironmentVariables)
Configures this handler internally (extention point).
|
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 void |
voidCleanUp(ExecutionContext context)
Performs as
cleanUp(ExecutionMonitor, ExecutionContext) that does nothing. |
protected void |
voidSetUp(ExecutionContext context)
Performs as
setUp(ExecutionMonitor, ExecutionContext) that does nothing. |
public final void configure(ServiceProfile<?> profile) throws InterruptedException, IOException
Service
configure
in interface Service
profile
- the profile of this serviceInterruptedException
- if interrupted in configurationIOException
- if failed to configure this servicepublic final String getHandlerId()
protected abstract void doConfigure(ServiceProfile<?> profile, Map<String,String> desiredProperties, Map<String,String> desiredEnvironmentVariables) throws InterruptedException, IOException
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 servicepublic final String getResourceId(ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException
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
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
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
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
monitor
- the progress monitor of the operationcontext
- the current execution contextInterruptedException
- if this operation is interruptedIOException
- if failed to setup the target environmentprotected final void voidSetUp(ExecutionContext context)
setUp(ExecutionMonitor, ExecutionContext)
that does nothing.context
- current contextprotected final void voidCleanUp(ExecutionContext context)
cleanUp(ExecutionMonitor, ExecutionContext)
that does nothing.context
- current contextCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.