public class Utilities extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Utilities.TokenType
Enumeration of types of token that can be serialized to/from strings.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIGURATION_KEPLER_DISTRIBUTED_CACHE_PATH |
static java.lang.String |
CONFIGURATION_KEPLER_INPUT_KEY_TYPE
The name of the configuration parameter specifying the input key type of the stub.
|
static java.lang.String |
CONFIGURATION_KEPLER_INPUT_TOKEN
The name of the configuration parameter specifying the name of the input token.
|
static java.lang.String |
CONFIGURATION_KEPLER_INPUT_VALUE_TYPE
The name of the configuration parameter specifying the input value type of the stub.
|
static java.lang.String |
CONFIGURATION_KEPLER_JOB_KEY_CLASS |
static java.lang.String |
CONFIGURATION_KEPLER_JOB_VALUE_CLASS |
static java.lang.String |
CONFIGURATION_KEPLER_MODEL
The name of the configuration parameter for the MoML of the sub-workflow.
|
static java.lang.String |
CONFIGURATION_KEPLER_MODEL_NAME
The name of the configuration parameter for the name of the sub-workflow.
|
static java.lang.String |
CONFIGURATION_KEPLER_MODEL_PATH
The name of the configuration parameter for the path of the sub-worflow MoML.
|
static java.lang.String |
CONFIGURATION_KEPLER_MODULES_DIR
The name of the configuration parameter for the path of the Kepler installation.
|
static java.lang.String |
CONFIGURATION_KEPLER_PARA_PARALLEL |
static java.lang.String |
CONFIGURATION_KEPLER_PARA_PREFIX |
static java.lang.String |
CONFIGURATION_KEPLER_PRINT_EXE_INFO |
static java.lang.String |
CONFIGURATION_KEPLER_REDIRECT_DIR
The name of the configuration parameter for the path to redirect display actors.
|
static java.lang.String |
CONFIGURATION_KEPLER_RUN_WORKFLOW_LIFECYCLE_PER_INPUT
The name of the configuration parameter specifying if the full lifecycle of the
sub-workflow should be executed for each input.
|
static java.lang.String |
CONFIGURATION_KEPLER_SAME_JVM
The name of the configuration parameter to specify running in the same JVM as Kepler.
|
static java.lang.String |
CONFIGURATION_KEPLER_SCRIPT_ENGINE_FACTORY_NAME
The name of the configuration parameter specifying the name of the script engine factory.
|
static java.lang.String |
CONFIGURATION_KEPLER_SINK_ACTOR_NAME
The name of the configuration parameter specifying the name of a DDPDataSink actor.
|
static java.lang.String |
CONFIGURATION_KEPLER_SOURCE_ACTOR_NAME
The name of the configuration parameter specifying the name of a DDPDataSource actor.
|
static java.lang.String |
CONFIGURATION_KEPLER_STUB_CODE
The name of the configuration parameter specifying the code to execute in the stub.
|
static java.lang.String |
CONFIGURATION_KEPLER_TAG |
Constructor and Description |
---|
Utilities() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkDirectorIterations(CompositeActor model,
boolean runWorkflowLifecyclePerInput)
Check the director and its iterations with the runWorkflowLifecyclePerInput value.
|
static Manager |
createManagerForModel(CompositeActor model,
ExecutionListener listener,
StubBaseActor stubSource,
StubBaseActor stubSink,
boolean runWorkflowLifecyclePerInput,
boolean enablePrintTimeAndMemory)
Create a Manager for a model and optionally start execution.
|
static Token |
createTokenFromString(java.lang.String tokenStr,
Type type)
Create a Token from a string based on the Ptolemy Type.
|
static Token |
createTokenFromString(java.lang.String tokenStr,
Utilities.TokenType type)
Create a Token from a string based on the TokenType enum.
|
static ConfigurationProperty |
getEngineProperty(java.lang.String engineName,
Nameable source)
Get the ConfigurationProperty for an Engine on the configuration file.
|
static java.lang.String[] |
getExecutionLanguageNames()
Get a list of available execution language names.
|
static java.util.List<java.lang.String> |
getJarsForLanguage(java.lang.String languageName)
Get the jars for a language.
|
static CompositeActor |
getModel(java.lang.String modelName,
java.lang.String modelString,
java.lang.String modelFile,
boolean sameJVM,
java.lang.String redirectDir)
Load the model for a stub from a Nephele Configuration.
|
static java.lang.String |
getScriptEngineFactoryName(java.lang.String languageName)
Get the script engine factory name for a language.
|
static java.lang.String |
getScriptEngineName(java.lang.String languageName)
Get the script engine name for a language.
|
static Utilities.TokenType |
getTokenTypeForSerialization(Token token)
Get the TokenType for a token.
|
static boolean |
isExecutingUnderResourceManager()
Returns true if an environment variable is set when
executing under a resource manager such as PBS or SLURM.
|
static void |
removeModelPorts(CompositeActor model)
Remove top-level ports and relations from a composite actor.
|
public static final java.lang.String CONFIGURATION_KEPLER_PARA_PREFIX
public static final java.lang.String CONFIGURATION_KEPLER_PRINT_EXE_INFO
public static final java.lang.String CONFIGURATION_KEPLER_TAG
public static final java.lang.String CONFIGURATION_KEPLER_PARA_PARALLEL
public static final java.lang.String CONFIGURATION_KEPLER_DISTRIBUTED_CACHE_PATH
public static final java.lang.String CONFIGURATION_KEPLER_JOB_KEY_CLASS
public static final java.lang.String CONFIGURATION_KEPLER_JOB_VALUE_CLASS
public static final java.lang.String CONFIGURATION_KEPLER_MODEL
public static final java.lang.String CONFIGURATION_KEPLER_MODEL_NAME
public static final java.lang.String CONFIGURATION_KEPLER_MODEL_PATH
public static final java.lang.String CONFIGURATION_KEPLER_MODULES_DIR
public static final java.lang.String CONFIGURATION_KEPLER_REDIRECT_DIR
public static final java.lang.String CONFIGURATION_KEPLER_SAME_JVM
public static final java.lang.String CONFIGURATION_KEPLER_SOURCE_ACTOR_NAME
public static final java.lang.String CONFIGURATION_KEPLER_SINK_ACTOR_NAME
public static final java.lang.String CONFIGURATION_KEPLER_INPUT_TOKEN
public static final java.lang.String CONFIGURATION_KEPLER_RUN_WORKFLOW_LIFECYCLE_PER_INPUT
public static final java.lang.String CONFIGURATION_KEPLER_STUB_CODE
public static final java.lang.String CONFIGURATION_KEPLER_INPUT_KEY_TYPE
public static final java.lang.String CONFIGURATION_KEPLER_INPUT_VALUE_TYPE
public static final java.lang.String CONFIGURATION_KEPLER_SCRIPT_ENGINE_FACTORY_NAME
public Utilities()
public static boolean checkDirectorIterations(CompositeActor model, boolean runWorkflowLifecyclePerInput)
model
- the model to execute in the stub.runWorkflowLifecyclePerInput
- if true, the full lifecycle of the
model will be executed for each input. If false, only one iteration of the
model will be execute for each input.public static Manager createManagerForModel(CompositeActor model, ExecutionListener listener, StubBaseActor stubSource, StubBaseActor stubSink, boolean runWorkflowLifecyclePerInput, boolean enablePrintTimeAndMemory)
model
- the workflowlistener
- an ExecutionListener to register with the Manager to
receive error messages.stubSource
- the source actor in the modelstubSink
- the sink actor in the modelrunWorkflowLifecyclePerInput
- if true, execute the full lifecycle of the
model for each input and the stub must tell the manager to execute the
model. If false, this method starts execution.enablePrintTimeAndMemory
- if true, print an execution summary each time
the model executes.public static CompositeActor getModel(java.lang.String modelName, java.lang.String modelString, java.lang.String modelFile, boolean sameJVM, java.lang.String redirectDir)
public static void removeModelPorts(CompositeActor model)
public static Token createTokenFromString(java.lang.String tokenStr, Type type)
public static Token createTokenFromString(java.lang.String tokenStr, Utilities.TokenType type)
public static Utilities.TokenType getTokenTypeForSerialization(Token token)
public static ConfigurationProperty getEngineProperty(java.lang.String engineName, Nameable source) throws IllegalActionException
engineName
- The name of the ddp enginesource
- The source object calling this methodIllegalActionException
public static java.lang.String[] getExecutionLanguageNames() throws IllegalActionException
IllegalActionException
public static java.util.List<java.lang.String> getJarsForLanguage(java.lang.String languageName) throws IllegalActionException
IllegalActionException
public static java.lang.String getScriptEngineName(java.lang.String languageName) throws IllegalActionException
IllegalActionException
public static java.lang.String getScriptEngineFactoryName(java.lang.String languageName) throws IllegalActionException
IllegalActionException
public static boolean isExecutingUnderResourceManager()