public final class RuntimeContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RuntimeContext.ExecutionMode
Represents execution type.
|
Modifier and Type | Field and Description |
---|---|
static RuntimeContext |
DEFAULT
Default context.
|
static String |
KEY_BATCH_ID
The value map key of
batchId(String) . |
static String |
KEY_BUILD_DATE
The value map key of build date.
|
static String |
KEY_BUILD_ID
The value map key of
buildId(String) . |
static String |
KEY_EXECUTION_MODE
The value map key of
mode(ExecutionMode) . |
static String |
KEY_FLOW_ID
The value map key of flow ID.
|
static String |
KEY_RUNTIME_VERSION
The value map key of
runtime version . |
static String |
PATH_APPLICATION_INFO
The relative path from classpath of application info.
|
Modifier and Type | Method and Description |
---|---|
RuntimeContext |
apply(Map<String,String> newValueMap)
Creates an inherited context from a value map.
|
RuntimeContext |
batchId(String newValue)
Creates an inherited context with specified batch ID.
|
RuntimeContext |
buildId(String newValue)
Creates an inherited context with specified verification code.
|
boolean |
canExecute(Object object)
Returns whether target object is executable in current execution mode.
|
boolean |
equals(Object obj) |
static RuntimeContext |
get()
Returns the global context.
|
static String |
getRuntimeVersion()
Returns the current runtime version.
|
int |
hashCode() |
boolean |
isSimulation()
Returns whether this execution is in simulation mode.
|
RuntimeContext |
mode(RuntimeContext.ExecutionMode newValue)
Creates an inherited context with specified execution mode.
|
static void |
set(RuntimeContext context)
Replaces the global context.
|
String |
toString() |
Map<String,String> |
unapply()
Creates a value map that describes this context.
|
void |
verifyApplication(ClassLoader classLoader)
Verifies application by using current context.
|
public static final RuntimeContext DEFAULT
public static final String PATH_APPLICATION_INFO
KEY_BATCH_ID
) KEY_FLOW_ID
) KEY_BUILD_ID
) public static final String KEY_EXECUTION_MODE
mode(ExecutionMode)
.apply(Map)
,
unapply()
,
Constant Field Valuespublic static final String KEY_BATCH_ID
batchId(String)
.apply(Map)
,
unapply()
,
Constant Field Valuespublic static final String KEY_FLOW_ID
public static final String KEY_BUILD_ID
buildId(String)
.apply(Map)
,
unapply()
,
Constant Field Valuespublic static final String KEY_BUILD_DATE
public static final String KEY_RUNTIME_VERSION
runtime version
.public static RuntimeContext get()
public static void set(RuntimeContext context)
context
- the replacementIllegalArgumentException
- if some parameters were null
public static String getRuntimeVersion()
public RuntimeContext mode(RuntimeContext.ExecutionMode newValue)
newValue
- execution modeIllegalArgumentException
- if some parameters were null
public RuntimeContext batchId(String newValue)
newValue
- batch ID, or null
to unset batch IDpublic RuntimeContext buildId(String newValue)
newValue
- verification code, or null
to unset verification codepublic RuntimeContext apply(Map<String,String> newValueMap)
newValueMap
- value mapIllegalArgumentException
- if some parameters were null
KEY_BATCH_ID
,
KEY_EXECUTION_MODE
,
KEY_BUILD_ID
public Map<String,String> unapply()
apply(Map)
public boolean isSimulation()
true
if this execution is in simulation mode, otherwise false
public boolean canExecute(Object object)
object
- target objecttrue
if is executable, otherwise false
IllegalArgumentException
- if some parameters were null
public void verifyApplication(ClassLoader classLoader)
classLoader
- application classesInconsistentApplicationException
- if failed to verifyIllegalArgumentException
- if some parameters were null
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.