Running H/F 1 461
* @see com.ibm.dse.base.OperationXValidate#validate(java.lang.String,
com.ibm.dse.base.DataField, com.ibm.dse.base.Context)
*/
public void validate(String arg0, DataField arg1, Context arg2)
throws DSETypeException {
// TODO Auto-generated method stub
}
}
4. Modify withdrawalClientOperation defined in Java Perspective
BTTBankApplicationClient appClientModule dseoper.xml to include
the reference to this validation class. See Example 8-49.
Example 8-49 withdrawalClientOperation
<operation
context="withdrawalClientCtx"
id="withdrawalClientOp"
serverOperation="withdrawalServerOp"
impClass="btt.bank.client.appl.WithdrawalClientOperation"
xVal="labs.WithdrawalValidate">
......
8.4.6 Creating the invoker
Instantiated by the Bean Invoker Factory, invokers enables Struts actions or
Java request handlers to access business processes and Single Action EJBs
through an EJB call.
When a request comes from a requester, which could be a request handler or a
Struts action, the request brings a request ID and a session ID to the Bean
Invoker Factory. The request ID indicates what kind of transaction the client is
requesting, and the session ID identifies the session of this transaction request.
The Bean Invoker Factory generates or allocates an invoker with the request ID
and session ID. The Bean Invoker Factory then returns the invoker to requester
so that the requester can send the request to the application logic layer.
462 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
Bean invoker pattern
This section describes some common ways that you can work with invoker
beans.
򐂰 Invoker bean overview
EJB methods are strongly typed and each EJB has its own corresponding
access information. In order to provide a generic way to access EJB,
invocation architecture is required.
The logic for creating Bean Invoker and bean invocation logic are
encapsulated within the Bean Invoker. Developers may invoke EJB
through a Bean Invoker with a generic interface.
The composition of Bean Invoker Pattern includes Bean Invoker Factory,
Basic Invoker Class (super class), end-user extended Bean Invoker class
and Bean Invoker Registry.
The Bean Invoker Pattern is shown in Figure 8-189.
Figure 8-189 Invoker pattern architecture
򐂰 Base invoker class
This is the abstract class that encapsulates some basic functions about
EJB accessing and cache mechanism.
Bean Invoker Pattern
Invoker Pool
EJB EJB
EJB EJB
Single Action
EJB
Bean
Invoker
Factory
Invoker
Registry
Invoker
Object
Invoker
Object
EJB Proxy Cache
EJB
Proxy
EJB
Proxy
requestID
Running H/F 1 463
It also provides all the format/unformat functions, for example,
StringFormatter, XMLFormatter, FloatFormatter, and so on.
Each bean invoker should be extended from the base invoker class. You
should manually modify it for each EJB method accessed.
򐂰 Interface for channels
Different channels should implement different invoker interfaces. The
defaults are:
BeanInvokerForJavaRequest:parseRequestData(String requestData)
BeanInvokerForStrutsAction:parseRequestData(Context requestData)
򐂰 End-user extended invoker
For each EJB method in Single Action EJB, the end-user must extend the
super invoker class. The logic for accessing the EJB method is defined in
this extended class.
executeEJB() should be overridden by the end-user.
End-user extended invoker implements different interfaces according to
the channels that use the Bean Invoker.
򐂰 Bean Invoker Factory
This is responsible for the Bean Invoker life cycle.
Only one instance of Bean Invoker Factory should be available in a JVM
(Factory Pattern).
Bean Invoker Factory maintains the invoker object cache and EJB proxy
object cache.
Exception handling.
򐂰 Bean Invoker Pool
It is used to store Bean Invoker Object.
It improve performance with caching.
򐂰 Bean Proxy Cache
It stores EJB Proxy Object.
It improves performance with EJB interaction.
It is session-relevant.
Session timeout handling
򐂰 Bean Invoker Registry (see Figure 8-190 on page 464 )
This is a resource bundle that stores the information that is required for
creating a Bean Invoker.
Each type of Bean Invoker should have its corresponding registry file.
It links a request ID to a given resource bundle name.
464 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
There are two ways of accessing resource bundle file: ResourceBundle
mode and Properties file mode.
Figure 8-190 Invoker Registry
Creating the Withdrawal invoker
To create the Withdrawal invoker, perform the following tasks:
1. Import a Web project for building the Invoker.
a. From the WebSphere Studio Application Developer menu, select File
Import.
b. In the dialog box that opens, select WAR file and click Next.
c. From WAR file field, browse to the directory
c:\7160code\cha8\BTTBankAppClientWeb.war.
d. For the Project field, click New... to create a New Dynamic Web Project
named BTTBankAppClientWeb, whose EAR project should be set as
Invoker Registry
BeanInvokerRegistry
Mapper.properties
requestID
#startupServerOp.properties
implClass=com.ibm.dse.samples.appl.StartupServerInvoker
jndiName=ejb/com/ibm/shanjh/cstest/StartupServerActionHome
factory=com.ibm.websphere.naming.WsninitialContextFactory
location=iiop://localhost:2809
homeClassName=com.ibm.cstest.StartupServerActionHome
isLocal=false
HelloWorld=/properties/HelloWorld.properties:PROP
startupServerOp=com.ibm.btt.cs.invoker.base.startupServerOp:RB
Running H/F 1 465
BTTBank by selecting the Configure advanced options check box and
clicking Next, as shown in Figure 8-191.
Figure 8-191 Import EAR and new BTTBankAppClientWeb

Get IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines 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.