IBM WebSphere Adapters Network Card User Manual


 
The sendWithReturn methods invoke onMessage on the InboundListener. This
method delivers the Record it received from the listener thread. Here the difference
is the onMessage method will be invoked on the InboundListener to deliver the
Record to the endpoint. The method would return Record as returned by
onMessage method.
The sendWithNoReturn method invokes onNotification on the InboundListener. The
sendEventWithReturn() method is not supported incase of multiple endpoint
factories configured, hence will throw an appropriate exception. Also, if there are
failures during the sending event when multiple endpoint factories configured, a
consolidated exception stack trace will be thrown with details like which
endpointfactory failed and for what reason.
Callback event sender constructors:
CallbackEventSender provides four different constructors to facilitate different
types of client invocation.
The following information describes the usage of the four constructors:
v CallbackEventSender(ArrayList, EventPersistence, XAResource,
ActivationSpecWithXid, LogUtils)
The complete constructor which takes an array of endpoint factories and
supports XA transaction with event persistence updates. If the input
ActivationSpecWithXid is valid and not null, event would be delivered by
calling target method on the inbound listener with ActivationSpecWithXid as
additional argument.
v CallbackEventSender(ArrayList, ActivationSpecWithXid, LogUtils)
Constructor used for event delivery without XA transaction and event
persistence support.
v CallbackEventSender(MessageEndpointFactory, EventPersistence, XAResource,
ActivationSpecWithXid, LogUtils)
This constructor does take the same arguments as (1) except that it takes one
MessageEndpointFactory instead of an array.
v CallbackEventSender(MessageEndpointFactory, ActivationSpecWithXid, LogUtils)
A slight variation for constructor (2) with just one MessageEndpointFactory
argument instead of an array.
Callback event processing for basic delivery
When the event is created at the EIS end, configured adapterListener gets notified
and it in turn instantiates CallbackEventSender. Here adapterListener decides
which method to invoke out of the four defined.
To implement callback mechanism, adapter must have an EndPointManager class.
The class needs to maintain the relationship between the activationSpec and
MessageEndpointFactory arguments. Here is a snippet of EndPointManager class
showing how the callback mechanism is implemented.
public class EndpointManager {
/**
* inner class which maintains pairs of mef and activationspec
*/
public static class EndpointPair {
public MessageEndpointFactory mef;
public ActivationSpec activationSpec;
92 WebSphere Adapters: WebSphere Adapter Toolkit User Guide