The ESB Run Framework API is a high level Java API enabling the execution and debug of ESB Components running in the ESB Run Framework.

ESB Run Framework Architecture

The ESB Run Framework consists of a client Run Handler connected to a domain of ESB Test Containers and a deployed ESB Run Service.

Test Containers

An ESB Test Container is a standard ESB Containers running in a TEST_CONTAINER_MODE. This mode is enabled by setting the ESB Container's deployment parameter 'TEST_CONTAINER_MODE' to true. This enables ESB Run Framework Reqeust Processing Locations in the components deployed to these containers. This in turn enables the execution of framework requests in these deployed components.

ESB Run Service

The ESB Run Service facilitates communication between a Run Handler and ESB Test Containers and coordinates execution of the deployed ESB components.

Run Handlers

A Run Handler connects the client runtime to the Run Service and facilitates the creation of run Executions in the ESB Test Framework

Run

A Run represents a single execution within the ESB Run Framework. It maintains and provides access to the state of that execution.

Event Request Manager and Event Requests

ESB Run Framework Clients control the execution of a Run by submitting EventRequests. The Run contains an EventRequestManager which maintains a sequence of EventRequests associated with the Run. Clients create EventRequests for subsequent processing by the Run through this EventRequestManager. These EventRequests are processed when the thread of execution of the Run reaches the Locations associated with each request. At each location, EventRequests are executed in the order they occur in the EventRequestManager. The EventRequestMananger maintains EventRequests in the order that they are created.

Event Queue and Events

ESB Run Framework Clients monitor the state of a Run's execution by consuming Events. The Run contains an EventQueue which maintains the sequence of Events received by the Run. An Event is generated and placed on the EventQueue each time the Run processes an EventRequest.

Starting Execution of a Run

The execution of a Run is initiated by invoking its start method. A RunContext is created in the ESB Run Framework to track the Run's thread of execution and any SendRunMessageRequest is processed.

Suspending and Resuming Run Execution

The execution of a Run can be suspended by invoking its suspend method. When invoked, the execution will suspend at the next location(s) encounted by the RunContext(s) of the run. The execution of the Run can be resumed by invoking its resume method.

An EventRequest may be configured to suspend the execution of a Run by setting the request's suspend property to true. When the request is processed, it will generate its Event and suspend execution of the Run at the Location the request was processed.The execution of the Run will remain suspended until resume is called on the event generated by the request. In general it is best practice for clients to always invoke resume on the events they consume when done processing them.

RemoteValues

ESB Run Framework Clients access the state of the framework during the execution of a run through the RemoteValues returned in the data property of Events. The type of data returned is determined by the Location associated with the event. Each Location type has a corresponding RemoteValue type that represents the remote data exposed by that locations of that type.

A RemoteValue is only valid while the Run is suspended at the Location of that remote value. In particular, RemoteValues from Events of EventRequests that do not suspend execution of a Run are never valid and RemoteValues become invalid once resume is invoked on thier Events.

Terminating Execution of a Run

A Run is terminated by invoking its close method. This terminates any threads of execution and removes any RunContexts in the ESB Run Framework associated with Run.