Writing a work agent implementation

The gw.api.integration.inbound.WorkAgent interface defines methods that coordinate and process work. You must write your own class that implements this interface.

To write a complete work agent implementation, you must write multiple related classes that work together. The following tables provide a summary of each class.

The following class is your top-level class.

Class that you write

Interface to implement

Description

A work agent

WorkAgent in package gw.api.integration.inbound.

The work agent implementation is the top level class that coordinates work for this service. The work agent instantiates your class that implements the interface Factory.

You use the following classes to find and prepare work during each polling interval.

Class that you write

Interface to implement

Description

A factory

Factory in package gw.api.integration.inbound.

For each polling interval, the factory instantiates the class that implements the interface WorkSetProcessor.

A work set processor

WorkSetProcessor in package gw.api.integration.inbound.work.

If your plugin supports the optional feature of being transactional, implement the subinterface TransactionalWorkSetProcessor.

The work set processor acquires and allocates resources. This class also instantiates the class that implements the interface Inbound.

The main method for processing one unit of work in a WorkData object is the process method in this class.

A class to find work

Inbound in package gw.api.integration.inbound.work.

The inbound class defines how to find work in its findWork method that returns new work data sets. This class also instantiates the class that implements the interface WorkDataSet.

The following classes represent the work itself.

Class that you write

Interface to implement

Description

A work data set

WorkDataSet in package gw.api.integration.inbound.work.

An object of this class represents the set of all data that the Inbound object found in this polling interval. This class encapsulates a set of work data (WorkData) objects and any necessary context information to operate on the data. This WorkDataSet object also instantiates the class that implements the WorkData interface.

Work data

WorkData in package gw.api.integration.inbound.work.

An object of this class represents one unit of work.