In this readme we explain in detail how to set up the PDK Lite V5 sample in the following environments:
We also describe how to change the default PDK Lite V5 application settings.
This section provides details on installing and running the PDK Lite V5.0 sample application in IBM WebSphere Application Server base V5.0.
Before you start installing PDK Lite, check the following prerequisites:
PDK Lite has the following system requirements:
The following product levels were used to develop and test PDK Lite. Please install these products at the specified version levels before attempting to install and run PDK Lite:
Before starting the PDK installation, make sure you have the following information available:
To install the PDK sample application in IBM WebSphere Application Server base V5.0:
When the script starts, you'll get another chance to confirm your environment variables settings. On Windows, close Notepad to return to the script, after you have re-checked the environment variables. The script will pause at each stage so you can review what's happening before continuing. On Windows, you'll see the DB2 command window open several times. Make sure you wait for the DB2 command window to finish before continuing the main script.
When the run_all script completes, you should be able to access the sample Web site with the URL http://localhost/selfservice/index.html . Click Continue to enter the site. You can then start the PDK application by clicking Run Application in the side menu.
You are presented with a start window showing the Guild's coat of arms. Clicking Click here to get the latest balances displays the balances for all weather stations and the Guild of Weather Masters. From there, you can then enter an amount to transfer from the Guild to one of the stations using a text entry field and a drop-down menu. Once you have submitted your transfer request, you are told whether it has succeeded or failed. You can then return to the balance display page to review the balances.
You can set up the PDK sample in IBM WebSphere Studio Application Developer. WebSphere Studio can be used to view or modify the application source code, and to run the application in the Studio test environment.
|
Note: This procedure assumes that you have already set up the required application databases. These are set up during the procedure described in IBM WebSphere Application Server base V5.0. |
To install the PDK sample application in the IBM WebSphere Studio Application Developer V5.0 for Windows/Linux workspace:
Note: Don't generate EJB deployment code for the CommandServerEJB project. The CommandServerSession EJB is implemented in the WebSphere command package, provided in the WebSphere runtime.
For the WebSphere Application Server embedded JMS provider (with WebSphere Application Server installed locally), we used:
For the WebSphere Studio unit test JMS provider (with WebSphere Application Server not installed locally):
Once you have installed the PDK, it is ready to run without any alteration. However, there are options you can specify to produce different effects, or to change the underlying technologies used, without having to change any source code.
The ExchangeRate session bean controls which topology is used for each planet in order to retrieve the exchange rate during a funds transfer. By default, the topologies that are executed are:
To change the topology, edit the backendList environment entry defined in the PDKLiteEJB module deployment descriptor for the ExchangeRate session EJB.
You can edit the deployment descriptor in IBM WebSphere Studio Application Developer V5.0, or in the Application Assembly Tool provided with WebSphere Application Server (type assembly from a command prompt).
The PDK sample application can be configured to access a CICS server using the WebSphere Administrative Console to set the ECICICS J2EE Connector adapter properties.
Source code for our CICS application is available in com/ibm/pdk/ejb/exchangeJ2C/cics/calcrate.c included in the PDKLiteEJB module.
The PDK sample application can be configured to access the back-end Web service running in a remote application server.
To access a remote server, edit the exchRateServerUrl environment entry defined in the PDKLiteEJB module deployment descriptor for the ExchangeRateWS session EJB.
You can edit the deployment descriptor in IBM WebSphere Studio Application Developer V5.0, or in the Application Assembly Tool provided with WebSphere Application Server (type assembly from a command prompt).
Deploy the updated PDK applications on the front-end application server as normal. Then deploy just ExchangeRateServer.ear on the remote application server.
By default, the weather stations are displayed in a rich graphical page, using special view bean methods to calculate the number of different pieces of weather reading equipment a station can afford.
If you would like to use a simpler (and faster) display, you can change the Struts action mapping for the display funds action in the WEB-INF/struts-config.xml file.
Change the "success" forward for the /displayFunds action path from:
Servlets in the Web application determine which type of command to use by making a call to the command factory Singleton class's getCommand(String type) method, passing the class name of the interface the command must implement (for example, GetAllBalancesCommand). This factory reads from the environment entries defined in the PDKLiteWeb module deployment desciptor. These environment entries map interfaces to implementing classes.
If you decide to write a new implementation, say of the GetAllBalancesCommand interface, edit the GetAllBalancesCommand environment entry to specify your new class as that which the factory should return.
You can edit the deployment descriptor in IBM WebSphere Studio Application Developer V5.0, or in the Application Assembly Tool provided with WebSphere Application Server (type assembly from a command prompt).
Similarly the type of Command Target to use is determined by making a call to the CommandTargetFactory class's getTarget() method. This returns an instance of the first valid class found using the commandTargetList environment entry defined in the PDKLiteWeb module deployment desciptor. To change the default Command Target, you must edit this environment entry. The PDKLiteWeb module also has an environment entry for each of the three provided Command Targets:
List only the command targets you want to use in the commandTargetList environment entry, colon (:) separated.
For example, listing only "commandTargetLocal" in commandTargetList will leave only the com.ibm.pdk.commandTargetUtil.LocalCommandTarget class. This ensures that all servlets use the command targeting policy best suited to running your Web and EJB containers on the same machine.
You can edit the deployment descriptor in IBM WebSphere Studio Application Developer V5.0, or in the Application Assembly Tool provided with WebSphere Application Server (type assembly from a command prompt).
You can add your own weather stations to the PDK Lite, by following these steps:
You can make the PDK Lite application run faster by disabling the comments written to the <WAS_HOME>/logs/server1/SystemOut.log file by the Java components in the PDK (servlets, command beans, and so on).
By default, debug mode is set to true. To set it to false, edit the file Logger.properties, found in the PDKSupport module that is packaged in each of the PDK enterprise applications (PDKLite.ear, ExchangeRateServer.ear, and CommandServer.ear). Change the line debug=true to debug=false .