com.ibm.streamsx.topology.context (Java Application API for IBM Streams)
Date: 2020-08-07

# Package com.ibm.streamsx.topology.context

Context for executing IBM Streams Java topologies.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  AnalyticsServiceProperties | Configuration properties for the Streaming Analytics service on IBM Cloud.
  ContextProperties | Properties that can be specified when submitting the topology to a context.
  JobProperties | Job properties specific to distributed contexts.
  Placeable<T extends Placeable<T>> | Placement directives for a topology element when executing in a distributed runtime.
  ResultProperties | Result properties.
  StreamsContext<T> | A `StreamsContext` provides the ability to turn a `Topology` into an executable.

- Class Summary
  Class | Description
  --- | ---
  StreamsContextFactory | Factory for creating `StreamsContext` instances.

- Enum Summary
  Enum | Description
  --- | ---
  StreamsContext.Type | Types of the `IBM Streams context` that a `Topology` can be executed against.

## Package com.ibm.streamsx.topology.context Description

Context for executing IBM Streams Java topologies.

### Submission/Execution

There are four (primary) mechanisms to submit or execute a Java topology:

- `StreamsContext.Type.DISTRIBUTED` - The topology is compiled into a Streams application bundle and submitted to a Streams instance.
- `StreamsContext.Type.BUNDLE` - The topology is compiled into a Streams application bundle which can then be submitted to a Streams instance.
- `StreamsContext.Type.STANDALONE` - The topology is compiled into a Streams application standalone bundle and executed as a separate child process of the Java virtual machine.
- `StreamsContext.Type.EMBEDDED` - The topology is executed using the Java Streams runtime, embedded within the Java virtual machine.

For a full list of the supported types of `StreamsContext` see `StreamsContext.Type`.

### SPL Compilation and Integration

When a Streams application bundle is produced, then the SPL compiler `sc` is used to produce the bundle (`sab` file). The toolkit path for compilation is:

1. The generated application toolkit containing the generated SPL code for the topology.
2. The com.ibm.streamsx.topology toolkit (its location is auto-discovered).
3. Toolkits added by `SPL.addToolkit(TopologyElement, File)` .
4. The value of the environment variable `STREAMS_SPLPATH` if it is set.
5. The toolkits from the Streams product: `$STREAMS_INSTALL/toolkits`.