Class 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:

    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

      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.
      • 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.