public interface IlrScenarioSuiteExecutionContext
IlrInitializable components receive an instance
of the scenario suite execution context when they are initialized.
During a parallel execution of a simulation, data is shared through the scenario suite execution
context. The context is created when the first instance of the parallel scenario provider
is initialized, and its method IlrParallelScenarioProvider.getScenarioSuiteParts()
is called by the SSP to retrieve the simulation parts.
After that, a new instance of the parallel scenario provider is created and
initialized for each part of the simulation.
When the first instance of the parallel scenario provider is initialized, the
getCurrentScenarioSuitePart() method of the scenario suite execution
context returns null because this initialization is not related to a part of the
simulation. The parallel scenario provider can use this first initialization step
to store data in the execution context, so that the parallel scenario
provider instances in charge of executing each simulation part can retrieve it
when they are initialized.
public class MyParallelScenarioProvider implements IlrParallelScenarioProvider {
public void initialize(IlrScenarioSuiteExecutionContext context) throws IlrScenarioProviderException {
IlrScenarioSuitePart currentScenarioSuitePart = context.getCurrentScenarioSuitePart();
if (currentScenarioSuitePart == null) {
// This is the initialization of the first parallel scenario provider instance.
// It is in charge of providing the scenario parts and the total number of scenarios.
Serializable sharedData = ...
context.setCustomData(sharedData);
} else {
// This is the initialization of a parallel scenario provider instance in charge of providing scenarios for a part.
Serialization sharedData = context.getCustomData();
...
}
}
...
}
| Modifier and Type | Method and Description |
|---|---|
IlrParallelScenarioProvider.IlrScenarioSuitePart |
getCurrentScenarioSuitePart()
During the parallel execution of a simulation, this method returns the current part
that is executed.
|
java.io.Serializable |
getCustomData()
Retrieves custom data previously stored in a context.
|
java.util.List<IlrKPI> |
getKPIs()
Returns the list of KPIs to be applied.
|
IlrObjectModelServices |
getObjectModelServices()
Returns the services for the object model the tested
ruleset is based on.
|
IlrObjectModelServicesFactory |
getObjectModelServicesFactory()
Gets an object model services factory.
|
IlrRuleAppDeployer |
getRuleAppDeployer()
Deprecated.
since 8.0 this information is no
longer valid, null is returned by this method.
|
IlrPath |
getRulesetPath()
Returns the path to the ruleset to be tested.
|
IlrRulesetSignature |
getRulesetSignature()
Returns the signature of the ruleset the scenario suite is run against.
|
IlrScenarioProvider |
getScenarioProvider()
Returns the scenario provider.
|
IlrScenarioSuiteDescriptor |
getScenarioSuiteDescriptor()
Returns the scenario suite descriptor used for initialization.
|
IlrScenarioSuiteTestResult |
getScenarioSuiteTestResult()
Returns the scenario suite test result.
|
IlrSessionFactory |
getSessionFactory()
Returns the rule session factory.
|
void |
setCustomData(java.io.Serializable customData)
Stores custom data into a context.
|
IlrRulesetSignature getRulesetSignature()
IlrObjectModelServices getObjectModelServices()
IlrSessionFactory getSessionFactory()
IlrScenarioSuiteDescriptor getScenarioSuiteDescriptor()
java.util.List<IlrKPI> getKPIs()
IlrRuleAppDeployer getRuleAppDeployer()
IlrPath getRulesetPath()
IlrObjectModelServicesFactory getObjectModelServicesFactory()
IlrScenarioProvider getScenarioProvider()
IlrScenarioSuiteTestResult getScenarioSuiteTestResult()
IlrParallelScenarioProvider.IlrScenarioSuitePart getCurrentScenarioSuitePart()
void setCustomData(java.io.Serializable customData)
customData - the custom data to be stored in the context.java.io.Serializable getCustomData()
setCustomData(Serializable).© Copyright IBM Corp. 1987, 2017