![]() |
Apama API Reference for .NET
10.15.2.4
|
The Scenario Service is an API for interacting with Apama applications from custom clients and dashboards running outside the correlator. More...
Inherits IDisposable.
Public Member Functions | |
void | AddListener (PropertyChangedEventHandler listener) |
Add a PropertyChangeListener that will be notified of changes to any bound property of this object. More... | |
void | AddListener (string propertyName, PropertyChangedEventHandler listener) |
Add a PropertyChangeListener that will be notified of changes to a specific named bound property of this object. More... | |
void | Destroy () |
Destroy this service and clean up resources; equivalent to calling Dispose(). More... | |
IScenarioDefinition | GetScenarioById (string scenarioId) |
Get a ScenarioDefinition for a specific scenario, using the ScenarioId as the lookup key. More... | |
IScenarioDefinition | GetScenarioByName (string scenarioDisplayName) |
Get a ScenarioDefinition for a specific scenario, using the Display name as the lookup key. More... | |
string [] | GetScenarioIds () |
Get the IDs of all known scenarios (not instances) in the correlator. More... | |
string [] | GetScenarioNames () |
Get the Display Names of all known scenarios (not instances) in the correlator. More... | |
IScenarioDefinition [] | GetScenarios () |
Get the ScenarioDefinitions of all known scenarios in the correlator. More... | |
void | RemoveListener (PropertyChangedEventHandler listener) |
Remove a PropertyChangeListener that was to be notified of changes to any bound property of this object. More... | |
void | RemoveListener (string propertyName, PropertyChangedEventHandler listener) |
Remove a PropertyChangeListener that was to be notified of changes to a specific named bound property of this object. More... | |
Properties | |
Dictionary< string, object > | Config [get] |
Get the configuration properties that define the requested operating semantics of this instance of the service. More... | |
bool | Destroyed [get] |
Determine if this service is destroyed. More... | |
DiscoveryStatus | DiscoveryStatus [get] |
Get the status of the internal scenario discovery process. More... | |
IEventService | EventService [get] |
Get the underlying EventService that is being used by this ScenarioService. More... | |
The Scenario Service is an API for interacting with Apama applications from custom clients and dashboards running outside the correlator.
For example, it can be used to listen for updates from applications that expose data through DataViews, or to create/edit/delete instances of queries.
Create an IScenarioService instance using the ScenarioServiceFactory. The PropertyChangedEventHandler
specified when the service is created will receive an asynchronous ScenarioServiceConstants.PropertyScenarioAdded notification for each available IScenarioDefinition as soon as the service successfully connects to the correlator, which you can use to create/edit/delete scenario instances, or to add a listener for the parameters of each IScenarioInstance.
The Scenario Service is built on the Apama.Services.Event.IEventService and is thread-safe. Note that unlike other parts of the Apama API, Scenario Service listener callbacks can be invoked while locks internal to the Scenario Service are held. For this reason it is not safe to call Scenario Service methods while holding any application-defined lock that might also be acquired within a Scenario Service property change listener, as this may result in deadlock.
void Apama.Services.Scenario.IScenarioService.AddListener | ( | PropertyChangedEventHandler | listener | ) |
Add a PropertyChangeListener that will be notified of changes to any bound property of this object.
When a client listener receives a PropertyChangeEvent from this interface, the following describes the type of the [old/new] value that is passed with the event:
listener | The listener to be notified. |
void Apama.Services.Scenario.IScenarioService.AddListener | ( | string | propertyName, |
PropertyChangedEventHandler | listener | ||
) |
Add a PropertyChangeListener that will be notified of changes to a specific named bound property of this object.
See AddListener(PropertyChangedEventHandler) for details about the property change events.
propertyName | The name of a specific property. |
listener | The listener to be notified. |
void Apama.Services.Scenario.IScenarioService.Destroy | ( | ) |
Destroy this service and clean up resources; equivalent to calling Dispose().
This will simulate a SenarioServiceUnloaded and cause all EventServiceChannels to be removed and disconnected from the correlator. If an EventService was created implicitly, it will be also disposed by this call.
.NET client applications should destroy any created scenario services once they are finished using them.
IScenarioDefinition Apama.Services.Scenario.IScenarioService.GetScenarioById | ( | string | scenarioId | ) |
Get a ScenarioDefinition for a specific scenario, using the ScenarioId as the lookup key.
scenarioId | the Id of the scenario for which the IScenarioDefinition is required. |
IScenarioDefinition Apama.Services.Scenario.IScenarioService.GetScenarioByName | ( | string | scenarioDisplayName | ) |
Get a ScenarioDefinition for a specific scenario, using the Display name as the lookup key.
scenarioDisplayName | the Id of the scenario for which the IScenarioDefinition is required. |
string [] Apama.Services.Scenario.IScenarioService.GetScenarioIds | ( | ) |
Get the IDs of all known scenarios (not instances) in the correlator.
The returned string Array is a shallow copy (new List) of the scenario Ids.
An array of the Ids of all of the scenarios. Each item is a String.
string [] Apama.Services.Scenario.IScenarioService.GetScenarioNames | ( | ) |
Get the Display Names of all known scenarios (not instances) in the correlator.
The returned string Array is a shallow copy (new List) of the scenario names.
An array of the Display Names of all of the scenarios. Each item is a String.
IScenarioDefinition [] Apama.Services.Scenario.IScenarioService.GetScenarios | ( | ) |
Get the ScenarioDefinitions of all known scenarios in the correlator.
The returned List is a shallow copy (new List) of the scenarios.
void Apama.Services.Scenario.IScenarioService.RemoveListener | ( | PropertyChangedEventHandler | listener | ) |
Remove a PropertyChangeListener that was to be notified of changes to any bound property of this object.
listener | The listener to be removed. |
void Apama.Services.Scenario.IScenarioService.RemoveListener | ( | string | propertyName, |
PropertyChangedEventHandler | listener | ||
) |
Remove a PropertyChangeListener that was to be notified of changes to a specific named bound property of this object.
propertyName | The name of a specific property. |
listener | The listener to be removed. |
|
get |
Get the configuration properties that define the requested operating semantics of this instance of the service.
|
get |
Determine if this service is destroyed.
|
get |
Get the status of the internal scenario discovery process.
|
get |
Get the underlying EventService that is being used by this ScenarioService.