IBM WebSphere Adapters Network Card User Manual


 
5. Set the name of the WebSphere business object complexType that corresponds
to this application entity
6. Set the event status to New.
Implementing event retrieval in the adapter
The careful work of implementing event retrieval in the adapter uses two
Foundation Classes interfaces. The goals are setting up event polling and a safe,
reliable connection to the event store.
Adapters that employ the Foundation Classes for event retrieval must meet the
following requirements:
1. Implementing interface com.ibm.j2ca.base.WBIPollableResourceAdapterWithXid
in any WBIResourceAdapter subclass.
2. Implementing interface
com.ibm.j2ca.extensions.eventmanagement.EventStoreWithXid
The first requirement identifies (for the Foundation Classes) the adapter for event
polling. If this interface is implemented, the Foundation Classes automatically
begin checking for and publishing events as dictated by polling-related
configuration properties such as PollPeriod and PollQuantity and as specified by
active adapter endpoints.
The second requirement, implementation of the EventStoreWithXid interface,
typically requires the most (adapter) development effort. As the location and
structure of each event store is application-specific, the EventStoreWithXid interface
provides the Foundation Classes with a common means of querying and
modifying an event store.
Implementing an EventStore Interface
An EventStore implementation is responsible for establishing and managing a
connection, if necessary, to the underlying EIS application. The EventStore
implementation should be thread-safe because it will be accessed on multiple
threads in Unordered delivery mode.
The table below describes the methods that each EventStore implementation must
provide:
EventStore methods
Method Description
public void setEventTransactionID(Event
event, XidImpl xid) throws
ResourceException, CommException
This method should store the xid in the
Event table in the same row specified by
event. xid.toString() will serialize the Xid for
easy storage.
public Xid[] getPendingTransactions()
throws ResourceException, CommException
This method should return the XIDs for
events that have an associated XID, but are
still in NEWEVENT status.
public Event getEventForXid(XidImpl xid)
throws ResourceException, CommException
This method should return the event
associated with the given Xid.
86 WebSphere Adapters: WebSphere Adapter Toolkit User Guide