394 Patterns: Implementing Self-Service in an SOA Environment
12.2.2 Object model
In this section, we provide an object model for our JCA scenario.
Class diagram
Figure 12-4 on page 394 shows a class diagram for the JCAModule portion of
the application. We focus on this piece because it provides the actual interface to
the back-end CRM system. The diagram shows the static relationships between
the classes.
MartAccounts and MartJ2CBeanImpl were developed for the ITSOMart
application. The rest of the classes are provided by the ECI resource adapter or
the J2EE packages.
Figure 12-4 Class diagram for J2EE Connector scenario
The com.ibm.patterns.jcaService package includes MartJ2CBeanImpl which
uses MartAccounts to update a customer record in the enterprise tier.
Chapter 12. J2EE Connector Architecture scenario 395
The MartAccounts class provides a byte array for the CICS COMMAREA, which
is used to pass the information to the back-end application. The MartAccounts
class is an implementation of the Record class provided by J2EE Connector
class library.
The ECIInteractionSpec class is the specification of an interaction for CICS ECI.
The superclass of ECIInteractionSpec is InteractionSpec. The various kinds of
resource adapters extend InteractionSpec.
InteractionSpec and Record are the only classes that need to be specific to a
particular resource adapter. If an application needs to interact with another
resource adapter, the only changes that need to be made are to use the new
Record class and InteractionSpec class. The use of the other classes, such as
ConnectionFactory, Connection, and Interaction, remains the same. For
example, if the application needs to have an interface with the IMS Resource
adapter, the application needs a new Record for IMS and it needs to create and
set an IMS InteractionSpec, which is passed to the generic interaction object.
Interaction diagram
The interaction diagram in Figure 12-5 shows the sequence of the message flow
for the JCA call within the ITSOMart application. Once the customer credit rating
is checked, the customer registration information is sent to the CRM application
and an e-mail is sent to the customer.
Figure 12-5 Interaction diagram for JCA functionality in ITSOMart scenario
Figure 12-6 on page 396 shows the message interactions of the classes.
396 Patterns: Implementing Self-Service in an SOA Environment
Figure 12-6 Sequence diagram for createCustomerJ2EE Connector scenario
1) Processor invokes the storeCustomerDetails_CICS() method of
ProcessorJCA.
2) ProcessorJCA invokes the createMartAccount_CICS method of
JCAWSClientBean to create the customer with the information
provided in CustomerDetails object.
2.1) JCAWSClientBean invokes the createCustomer() method of
MartJ2CBeanImplProxy.
2.1.1) MartJ2CBeanImplProxy invokes the createCustomer() method of
MartJ2CBeanImpl.
2.1.1.1) MartJ2CBeanImpl gets a connection using a connection factory. The
runtime connection attributes are configured from the application
server connection factory properties. This may not mean a physical
connection to the enterprise has been opened. A physical connection
c
:MartJ2CBeanImp/Proxy
self:Processor
c
I
:ConnectionFactory
c
:ProcessorJCA
c
:JCAWSClientBean
c
:MartAccounts
c
:MartJ2CBeanImpl
I
:Connection
I
:Interaction
I
:Record
c
:ECIInteractionSpec
1: storeCustomerDetails_CICS
2: createMartAccount_CICS
2.1: createCustomer
2.1.1: createCustomer
2.1.1.1: getConnection
2.1.1.2: createInteraction
2.1.1.2.1: \CalledOperation\
2.1.1.3: ECIInteractionSpec
2.1.1.4: setCommareaLength
2.1.1.5: setReplyLength
2.1.1.6: setFunctionName
2.1.1.7: setInteractionVerb
2.1.1.8: \CalledOperation\
2.1.1.9: execute
2.1.1.10: \CalledOperation\
2.1.1.12: close
2.1.1.13: close
2.1.1.11: \CalledOperation\
<<return>>
2.1.2: createCustomer
<<return>>
3: createMartAccount_CICS
<<return>>
Web Service:
<<return>>
2.2: createCustomer

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.