Chapter 5. Using J2EE Connector Architecture 97
The client uses an interaction to execute functions on the EIS. The interaction
modes involves how the request is handled by the resource adapter and is
specified on the InteractionSpec by stating one of the following:
???? SYNC_SEND
The execution only sends an input to the EIS via the resource adapter. No
output is expected.
???? SYNC_RECEIVE
The execution receives a synchronous output record from the EIS.
???? SYNC_SEND_RECEIVE
The execution sends an input to the EIS, and a synchronous output record is
expected.
The EIS can also make calls into the application component using Enterprise
JavaBeans (EJB) that are deployed on the application server. Inbound
communication is only available when the adapter is running in a J2EE
application server.
5.2 EIS integration using J2C
This section describes how to use a J2C resource adapter in various integration
schemes. EIS-based integration typically involves a J2C resource adapter that is
running in managed mode to take advantage of the application servers quality of
service functionality.
As mentioned earlier, a resource adapter can expose its outbound functionality
through CCI. This functionality can directly interact with the EIS. The EIS
connectivity framework provides a facade into the EIS via the resource adapter,
which provides de-coupling between the service provided by the J2C resource
adapter and application services.
The JCA 1.5 specification stipulates how inbound communication can be
accomplished using EJB. EJB enables the EIS to make calls to the application
component when events occur in the EIS system.
5.2.1 J2C outbound integration pattern
The outbound integration pattern involves an application component that is
running on an application server or stand-alone Java application, which executes
requests on the J2C resource adapter that interacts with the EIS.
98 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
There are two basic patterns when running on an application server, one involves
straight calls and the other involves exposing the resource adapter as a service.
Common Client Interface invocation
The patterns when interacting from within an application server use an EJB to
make calls on the resource adapter through CCI calls. The EJB can then be
exposed as an Enterprise Application Integration framework within the managed
application space, or it can used directly. Developing a framework gains flexibility
and potentially eases integration with other parts of the application.
Example 5-1 is shows the sample code which makes a call on a resource
adapter.
Example 5-1 Sample CCI call to an EIS
ConnectionFactory cicsFactory =ServiceLocator.getConnectionFactory(“eis/CICS”);
Connection conn = cicsFactory.getConnection();
InteractionSpec spec = new ECIInteractionSpec();
spec.setCommareaLength(commAreaLength);
spec.setTPName(“TRDR”);
spec.setFunctionName(“TRADERBL”);
Interaction interaction = conn.createInteraction(spec);
interaction.execute(spec,requestRecord, responseRecord);
Enterprise Application Integration framework
The Enterprise Application Integration (EAI) framework is the implementation of
a system process of the EIS component model that is described in the following
sections:
???? 2.2.2, “Architecture options” on page 30
???? 2.2.5, “Conceptual architecture” on page 37
???? 7 2.2.6, “Logical architecture” on page 47
The EIS system process uses a session bean implementation. The EIS features
are a Java implementation of existing functions in the EIS.
The EAI framework interacts with the EIS through the resource adapter and is
exposed as features that the session bean uses. This interaction creates
flexibility and de-coupling of the EIS features that are used when integrating. It
allows for the quick reuse of existing features (for example, GetCompanyList that
is used to retrieve a list of companies in the system). The EAI framework gives
developers an clearly defined infrastructure on how they should add new
features and extend the EIS access.
Chapter 5. Using J2EE Connector Architecture 99
Service invocation
The resource adapter exposed as a service can be used in several different
ways. It can be used within the Business Process Container as a partner link. It
can also be used in conjunction with the Web Services Gateway, providing for
some routing and flexibility.
When the resource adapter is exposed as a service within the Business Process
Container, the clients make use of the Web Service Invocation Framework
(WSIF) to make requests using the binding type that was specified when the
service was deployed.
WSIF provides an abstract model that invokes Web services through a set of
APIs regardless of how the service is implemented and where it can be found.
WSIF is composed of these features:
???? An API, which provides binding independent access of a Web service through
the use of an abstract model of the service.
???? WSIF providers, which implement support for different transports and
encodings through the use of the dynamic port factory.
???? Utilities such format handlers, which support the functionality that is provided
by the WSIF providers and the API.
There are several binding types, including EJB, JMS, SOAP, and J2C. The WSIF
J2C binding extension provides for an easy mapping of ports, operations, and
messages to the resource adapters connection, interaction, and records. The
connector bindings extension allows the resource adapter WSDL to specify the
InteractionSpec values in a way that is understandable. A format binding
specifies what message style and encodings are used, when mapping the data
to its native format. For example, IBM CICS Resource Adapter, which uses
COBOL copybook, has an encoding value of ibmcobol.
The client looks up the port, where the resource adapter service is located and
uses the WSIFPort to create an operation that specifies the operation name as
well as input and output message types. It then creates an input object and sets
the parts of the message. Finally, the client executes the operation.
After the adapter service is created using the WSIF J2C binding extension, it can
then be wrapped into a service using one of the following bindings for easy
access within the application server.
???? EJB binding
Exposes the functionality as a EJB call into the resource adapter service.
100 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
???? JMS binding
Uses a simulated synchronous JMS system to send messages to the
resource adapter’s service.
When the resource adapter is exposed as a service, a client can use the IBM
Web Services Gateway to make requests on the resource adapter.
IBM Web Services Gateway overview
The IBM Web Services Gateway is a runtime infrastructure component that
serves as a SOAP processing engine that provides configurable mappings
between Web service providers and requesters. Services defined with WSDL
can be routed to available transport channels and ultimately the target service.
The gateway components are:
???? Channels that define the entry-points into the gateway and carry the Web
service request and response through the gateway.
???? Filters that are used to intercept service invocations which come into the
gateway and act upon the services.
???? Services that are described with the help of a Web Services Description
Language (WSDL) document.
???? UDDI references to manage the publishing of an exposed Web service to a
private or public UDDI registry.
The Web Services Gateway provides the following functionality:
1. Routes messages to the target destination.
2. Provides processing for custom header tags.
3. Provides for message level security using WS-Security.
4. Provides for changes to the incoming protocol with a different outgoing
protocol (SOAP-HTTP to SOAP-JMS).
When the resource adapter service is exposed through the IBM Web Services
Gateway there is a mapping from the requestor to the provider using channels.
The resource adapters then make a call to the EIS, returning the results through
the service. This integration pattern enables the integration of the EIS through an
ESB implementation.
For more information about the IBM Web Service Gateway, see:
???? WebSphere Version 5.1 Application Developer 5.1.1 Web Services
Handbook, SG24-6891
???? Patterns: Service-Oriented Architecture and Web Services, SG24-6303
Chapter 5. Using J2EE Connector Architecture 101
5.2.2 J2C inbound integration pattern
For inbound communication the EIS component can make calls on session
beans, entity beans, and Message Driven Beans (MDB). This event notification
or asynchronous messaging is defined in the message inflow contract.
The message inflow contract defines how a resource adapter communicates with
interested parties to events happening in the EIS. Each interested party is a
MessageEndPoint. The application server loads the MessageEndPoints into the
MessageEndPointFactory and registers each of them with the resource adapter
through using the message inflow contract.
Figure 5-1 illustrates the contract.
Figure 5-1 Inbound message flow contract
The application server uses the activation specification which was configured by
the MessageEndPoint during deployment to register the endpoint with the
resource adapter. The application server calls the endpointActivation() method
on the resource adapter, which should enable the resource adapter to send
messages to the application component represented by the endpoint.The
MessageEndPoint implements a MessageListener interface which the resource
adapter specifies through the ActivationSpec. Using the method(s) of the
MessageListener interface the resource adapter notifies the MessageEndPoint
about events in the EIS.
The resource adapter then serves as a conduit between the application
component (MessageEndPoint) and the EIS. The resource adapter can monitor
the EIS for activity using with work management contract to schedule work with
the WorkManager. The resource adapter can also register with the EIS if such an
event notification registration system exists within the EIS. In this case there is
Application Server
createEndpoint ( )
endpointActivation ( )
endpointDeactivation ( )
isDeliveryTransacted ( )
beforeDelivery ( )
invoke message delivery
afterDelivery()
Application Component
Activation Spec
EIS
Message
Endpoint
Event Worker Thread
Message
Endpoint
Factory
Resource Adapter
J2C Resource Adapter
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset