Using Adapter Activities

TODO: Need to remove all references to connection pools and add correct information about using the PoolableAdapterBase API.

The class AdapterActivityBase is an abstract class that provides common base for all adapter activities, and most activities extend this base class directly.

The adapters can be directly used and support automatic retries through adapter configuration rather than a retry loop (a link from it to itself) as typically used with old implementors. In order to keep backward compatibility, we introduced a new base class, PoolableAdapterBase, to support the new functionalities. This is a new implementation of JMS Adapter which can be configured through MDW Studio and does not implement ControlledAdapterActivity interface.

MDW provides a set of common adapters for common protocols such as SOAP based MDW web services, JMS, as well as the adapter activity, mentioned above. These adapters are highly configurable and hence can meet common needs in many cases. You may however encounter situations where further customization beyond configuration is needed. Here is a list of common reasons:

The next section describes such customizations in details.

Implementing Poolable Adapters

A new poolable adapter should extend the abstract base class com.centurylink.mdw.workflow.adapter.PoolableAdapterBase. The following methods may be overridden less commonly:

You can look at built-in poolable adapters as samples. We note that the built-in adapters typically do not throw exceptions when it receives any messages from external systems, even the messages may indicate some error conditions (e.g. an XML message that contains an error message). This is obviously due to the fact that there is no generic way to identify what messages indicate errors. When you implement your application-specific adapters, which you may have knowledge as to what response messages indicate errors, you should throw exceptions as described above appropriately, so that the auto-retry mechanism can function properly.

Implementing Poolable Adapter Activities

The built-in implementor PoolableAdapterBase is implemented as a subclass of DefaultActivityImpl as well. The methods that may need to be overridden include:

  • doInvoke
  • onSuccess
  • onFailure
  • getRequestData