Class ScenarioServiceFactory
- java.lang.Object
-
- com.apama.services.scenario.ScenarioServiceFactory
-
public class ScenarioServiceFactory extends java.lang.Object
ScenarioServiceFactory is a class that provides factory methods for creating new instances of IScenarioService.Note that Queries and DataViews are both represented as "scenarios" in this API.
There are 3 variants of the factory methods:
- Client supplies correlator host & port;
- Client supplies an initialised
EngineClientInterface
(usually an EngineClientBean); - Client supplies an initialised
IEventService
For each of the above factory methods, the client must also supply parameters for a configuration map, and a listener. Either of those additional parameters may be null. For more details of the configuration parameter, see the documentation for
IScenarioService
, andScenarioServiceConfig
. The names of the bound properties for which the listener will be notified are those properties ofIScenarioService
whose names begin "PROPERTY_", e.g.IScenarioService.PROPERTY_SCENARIO_ADDED
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IScenarioService
createScenarioService(EngineClientInterface engineClient, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance using the supplied EngineClient to connect to a Correlator, and optionally pass a listener that will be added before any events are received.static IScenarioService
createScenarioService(IEventService eventService, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance using the supplied IEventService to connect to a Correlator, and optionally pass a listener that will be added before any events are received.static IScenarioService
createScenarioService(java.lang.String socket_hostname, int socket_port, java.lang.String processName, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance with an EngineClient connected to a Correlator on the given host and port, and optionally pass a listener that will be added before any events are received.static IScenarioService
createScenarioService(java.lang.String socket_hostname, int socket_port, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance with an EngineClient connected to a Correlator on the given host and port, and optionally pass a listener that will be added before any events are received.
-
-
-
Method Detail
-
createScenarioService
public static IScenarioService createScenarioService(java.lang.String socket_hostname, int socket_port, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance with an EngineClient connected to a Correlator on the given host and port, and optionally pass a listener that will be added before any events are received. The listener will be notified of changes to any bound property of this IScenarioService.The IScenarioService must be explicitly destroyed when it is no longer required. The EventService and MessagingClient associated with this ScenarioService will be destroyed automatically, when the scenario service is destroyed.
- Parameters:
socket_hostname
- Name of the host where the Correlator is running.socket_port
- Port number on which the Correlator is listening.scenarioServiceConfig
- Configuration properties for the scenario service. (The Map may also contain EventServiceChannel configuration properties.)listener
- The listener to be notified of property changes.- Returns:
- the new IScenarioService instance.
-
createScenarioService
public static IScenarioService createScenarioService(java.lang.String socket_hostname, int socket_port, java.lang.String processName, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance with an EngineClient connected to a Correlator on the given host and port, and optionally pass a listener that will be added before any events are received. The listener will be notified of changes to any bound property of this IScenarioService.The IScenarioService must be explicitly destroyed when it is no longer required. The EventService and MessagingClient associated with this ScenarioService will be destroyed automatically, when the scenario service is destroyed.
- Parameters:
socket_hostname
- Name of the host where the Correlator is running.socket_port
- Port number on which the Correlator is listening.processName
- A display name to identify which application is responsible for this connection to the Correlator (this name is included in log files for diagnostic purposes)scenarioServiceConfig
- Configuration properties for the scenario service. (The Map may also contain EventServiceChannel configuration properties.)listener
- The listener to be notified of property changes.- Returns:
- the new IScenarioService instance.
-
createScenarioService
public static IScenarioService createScenarioService(EngineClientInterface engineClient, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance using the supplied EngineClient to connect to a Correlator, and optionally pass a listener that will be added before any events are received. The listener will be notified of changes to any bound property of this IScenarioService.The IScenarioService must be explicitly destroyed when it is no longer required. The EventService associated with this ScenarioService will be destroyed automatically, when the scenario service is destroyed. The engine client will not.
- Parameters:
engineClient
- the EngineClient to be used by the new scenario service.scenarioServiceConfig
- Configuration properties for the scenario service. (The Map may also contain EventServiceChannel configuration properties.)listener
- The listener to be notified of property changes.- Returns:
- the new IScenarioService instance.
-
createScenarioService
public static IScenarioService createScenarioService(IEventService eventService, java.util.Map<java.lang.String,java.lang.Object> scenarioServiceConfig, java.beans.PropertyChangeListener listener)
Create a new ScenarioService instance using the supplied IEventService to connect to a Correlator, and optionally pass a listener that will be added before any events are received. The listener will be notified of changes to any bound property of this IScenarioService.The IScenarioService must be explicitly destroyed when it is no longer required. The EventService and MessagingClient associated with this ScenarioService must also be destroyed by the caller, this will not happen automatically.
- Parameters:
eventService
- the IEventService to be used by the new scenario service.scenarioServiceConfig
- Configuration properties for the scenario service. (The Map may also contain EventServiceChannel configuration properties.)listener
- The listener to be notified of property changes.- Returns:
- the new IScenarioService instance.
-
-