146 WebSphere Business Integration Adapters
sequential event processing request is received, this method is called to
undertake the interaction with the adapter. This action is typically known as
callback, because the communication code must callback into the adapter to
interact with the framework and ultimately the broker. Although it is possible to
embed all functionality within the communication code, you would still need to
call all WebSphere Business Integration Adapter Framework code through a
callback to methods that were inherited by the custom connector agent class.
What does it mean to develop a custom adapter? The following are two cases
that use different technologies to call the executeCollaboration method:
Case 1: Interacting with a back-end application with RMI
Within this scenario, the back-end application is capable of issuing RMI calls
to an adapter that then issue the executeCollaboration method to process
the synchronous event request.
Case 2: Interacting with a back-end application with TCP/IP sockets
With any TCP/IP sockets transport, there are multiple ways of interacting with
the back-end application. For simplicity, we assume that the adapter opens a
separate server socket to handle synchronous event requests from the
back-end application.
9.3 Single or multithreaded support for sequential event
processing
When designing the sequential event processing mechanism for a custom
adapter, you must understand the back-end application requirements. Will the
application only make sequential event requests serially, or will the application
require the custom adapter to process multiple sequential events concurrently?
Fortunately, beyond potentially making the development of the communication
code more complex, multithreaded support is available.
Returning to our previous two scenarios, using RMI as the transport mechanism
provides multithreaded support automatically, because each call into the RMI
stub runs on a thread that is created by the RMI. So, if you were to make
simultaneous multiple calls to the sequential event processing, RMI would start
multiple threads automatically to concurrently process the request. Within
Note: We do not recommended that you call the executeCollaboration
method from within an event processing mechanism, because this method is
synchronous and blocks the event processing until a response is received.