StreamsContextFactory (Java Application API for IBM Streams)
Date: 2020-08-07

com.ibm.streamsx.topology.context

## Class StreamsContextFactory

- java.lang.Object
- - com.ibm.streamsx.topology.context.StreamsContextFactory

-     public class StreamsContextFactory
      extends java.lang.Object

  Factory for creating `StreamsContext` instances.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamsContextFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getDefaultDomainId()` Get the default Streams domain identifier.
    `static java.lang.String` | `getDefaultInstanceId()` Get the default Streams instance identifier.
    `static java.lang.String` | `getDefaultStreamsInstall()` Get the default Streams install location.
    `static StreamsContext<com.ibm.streams.flow.javaprimitives.JavaTestableGraph>` | `getEmbedded()` Get an `EMBEDDED context`.
    `static StreamsContext<?>` | `getStreamsContext(StreamsContext.Type type)` Get a `StreamsContext` from its type.
    `static StreamsContext<?>` | `getStreamsContext(java.lang.String type)` Get a `StreamsContext` from its type name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StreamsContextFactory

          public StreamsContextFactory()

  - ### Method Detail

    - #### getEmbedded

          public static StreamsContext<com.ibm.streams.flow.javaprimitives.JavaTestableGraph> getEmbedded()

      Get an `EMBEDDED context`.
      Topology is executed within the Java virtual machine that declared it. This requires that the topology only contains Java functions or primitive operators.
      Returns:
        An `EMBEDDED context`.
      See Also:
        `StreamsContext.Type.EMBEDDED`

    - #### getStreamsContext

          public static StreamsContext<?> getStreamsContext(java.lang.String type)

      Get a `StreamsContext` from its type name.
      Parameters:
        `type` - Name of the `type` from its enumeration name.
      Returns:
        An `StreamsContext` instance.
      See Also:
        `StreamsContext.Type`

    - #### getStreamsContext

          public static StreamsContext<?> getStreamsContext(StreamsContext.Type type)

      Get a `StreamsContext` from its type.
      Parameters:
        `type` - `Type` of the context.
      Returns:
        An `StreamsContext` instance.
      See Also:
        `StreamsContext.Type`

    - #### getDefaultDomainId

          public static java.lang.String getDefaultDomainId()

      Get the default Streams domain identifier.
      Returns the default Streams domain identifier used by contexts `DISTRIBUTED` and `DISTRIBUTED_TESTER`.

      This is obtained from the environment variable `STREAMS_DOMAIN_ID`.

      Returns:
        Default Streams domain identifier.
      Since:
        1.7

    - #### getDefaultInstanceId

          public static java.lang.String getDefaultInstanceId()

      Get the default Streams instance identifier.
      Returns the default Streams instance identifier used by contexts `DISTRIBUTED` and `DISTRIBUTED_TESTER`.

      This is obtained from the environment variable `STREAMS_INSTANCE_ID`.

      Returns:
        Default Streams instance identifier.
      Since:
        1.7

    - #### getDefaultStreamsInstall

          public static java.lang.String getDefaultStreamsInstall()

      Get the default Streams install location.
      Returns the default Streams install location used by contexts `BUNDLE`, `STANDALONE_BUNDLE`, `STANDALONE`, `STANDALONE_TESTER`, `DISTRIBUTED` and `DISTRIBUTED_TESTER`.

      This is obtained from the environment variable `STREAMS_INSTALL`.

      Returns:
        Default Streams install.
      Since:
        1.7