IBM WebSphere Adapters User Manual page 99

Version 6 release 2
Table of Contents

Advertisement

public EndpointPair(MessageEndpointFactory mef, ActivationSpec activationSpec) {
this.mef = mef;
this.activationSpec = activationSpec;
}
public boolean equals(Object o) {
if (!(o instanceof EndpointPair)) {
return false;
}
EndpointPair other = (EndpointPair) o;
return other.mef.equals(this.mef) && other.activationSpec.equals(this.activationSpec);
}
}
// adds new endpointPair to the list
public void addEndpoint(MessageEndpointFactory mef, ActivationSpec activationSpec)
throws ResourceException {...}
}
The adapter listener gets all MessageEndpointFactories for the current
activationSpec and registers that with the CallbackEventSender instance.
EndpointManager epManager = ((ResourceAdapter)aSpec.getResourceAdapter()).getEndpointManager();
EndpointPair[] endpoints = epManager.getEndpoints(this.aSpec);
if (!isSynchronous && aSpec.getAssuredOnceDelivery().booleanValue())
{// XA Delivery
callbackEventSender = new CallbackEventSender(endPointList,
eventRecMngr.getEventPersistance(), XAres, aSpec,
logger.getLogUtils());
} else {// Non XA delivery
callbackEventSender = new CallbackEventSender(endPointList,
aSpec, logger.getLogUtils());
}
/* Refer to the Callback event sender constructors section for more
information.
Note: The adapter listener creates the worker threads to take care of calling
and getting responses from the callBackEventSender method. */
Once the program control gets into CallbackEventSender, it checks how many
EndpointFactories are configured for the current instance of adapter. If there is
more than one, then it delivers the event by creating endpoints for each of them
and invoking either onNotification or onMessage method on the endpoint with out
any XA transaction. Finally, it would call the release() method on the end point to
free the endpoint hence the application server can add it to endpoint pool. Finally
it would call release() method on the end point to free the endpoint hence the
application server can add it to endpoint pool.
Also it invokes beforeDelivery() and afterDelivery() methods on the endpoint as
defined by the JCA functional specification.
XA transaction will come into picture only when the adapter is configured with
ONE EndpointFactory. The following sequence diagram depicts the callback event
processing for basic delivery.
WebSphere Adapter development overview
93

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Websphere adapter toolkit

Table of Contents