com.apama.services.scenario
Class ScenarioServiceFactory

java.lang.Object
  extended by 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.

There are 3 variants of the factory methods:

  1. Client supplies correlator host & port;
  2. Client supplies an initialised EngineClientInterface (usually an EngineClientBean);
  3. 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, and ScenarioServiceConfig. The names of the bound properties for which the listener will be notified are those properties of IScenarioService whose names begin "PROPERTY_", e.g. IScenarioService.PROPERTY_SCENARIO_ADDED

See Also:
IScenarioService, ScenarioServiceConfig, ScenarioServiceFactory

Method Summary
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.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.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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG