Handling Inbound Messages Proprietary Communications Channel and Protocol

7-4 Programming Resource Adapters for Oracle WebLogic Server

7.2 How Message Inflow Works

A resource adapter that supports inbound communication from an EIS to the application server typically includes the following: ■ A proprietary communications channel and protocol for connecting to and communicating with an EIS. The communications channel and protocol are not visible to the application server in which the resource adapter is deployed. See Appendix 7.2.2, Proprietary Communications Channel and Protocol. ■ One or more message types recognized by the resource adapter. ■ A dispatching mechanism to dispatch a message of a given type to another component in the application server.

7.2.1 Handling Inbound Messages

A resource adapter may handle an inbound message in a variety of ways. For example, it may: ■ Handle the message locally, that is, within the ResourceAdapter bean, without involving other components. ■ Pass the message off to another application component. For example, it may look up an EJB and invoke a method on it. ■ Send the message to a message endpoint. Typically, a message endpoint is a message-driven bean MDB. For more information, see Appendix 7.3, Message Inflow to Message Endpoints Message-driven Beans. Inbound messages may return a result to the EIS that is sending the message. A message requiring an immediate response is referred to as synchronous the sending system waits for a response. This is also referred to as request-response messaging. A message that does not expect a response as part of the same exchange with the resource adapter is referred to as asynchronous or event notification-based communication. A resource adapter can support asynchronous or synchronous communications for all three destinations listed above. Depending upon the transactional capabilities of the resource adapter and the EIS, inbound messages can be either part of a transaction XA or not non-transactional. If the messages are XA, the controlling transaction may be coordinated by an external Transaction Manager transaction inflow or by the application servers Transaction Manager. See Appendix 7.4, Transactional Inflow. In most cases, inbound messages in a resource adapter are dispatched through a Work instance in a separate thread. The resource adapter wraps the work to be done in a Work instance and submits it to the application servers Work Manager for execution and management. A resource adapter can submit a Work instance using the doWork , startWork, or scheduleWork methods depending upon the scheduling requirements of the work.

7.2.2 Proprietary Communications Channel and Protocol

The resource adapter can expose connection configuration information to the deployer by various means; for example, as properties on the ResourceAdapter bean or properties on the ActivationSpec object. An alternative is to use the same communication channel for inbound as well as outbound traffic. Thus you can also set configuration information on the outbound connection pool. Message and Transactional Inflow 7-5

7.3 Message Inflow to Message Endpoints Message-driven Beans