Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




WebLogic Server

software


WebLogic Server

Description

This PowerBuilder 10 sample provides a client application that accesses an entity Enterprise JavaBeans (EJB) component and a stateless session EJB provided by BEA as examples on WebLogic Server version 7.0.



Features

PB - EJB client

Setting up Your Environment

PowerBuilder 10

WebLogic Server (version 7 was used for this e 818b13i xample)

Detailed Steps

  1. Follow the steps outlined by BEA to install the examples.ejb20.basic.statelessSession and examples.ejb20.basic.containerManaged examples.  Browse to iiop://<yourserver>:7001 for instructions on how to do this.
  2. Unzip the file provided here into a folder (for example, c:\ejbclient).
  3. Open the workspace weblogic.pbw. If an error message occurs indicating that the PBEJBCLIENT100.PBD is invalid or cannot be found, add that file to the target's library list. The PBD can be found in the Sybase/Shared/PowerBuilder directory in the directory where you installed PowerBuilder.
  4. Run the application using the running man.
  5. Modify the server URL (if necessary) and the CLASSPATH to reflect the location of the required JAR files in your WebLogic installation.
  6. Press the Connect button to connect to the server. Once connected, explore the functionality on each of the two tabs.

Implementation Notes

This example was designed for reuse as a sample application for the EJB client functionality across multiple J2EE servers. ejbshared.pbl contains a number of general purpose objects that help support the reuse.

pg_base is the ancestor of all tab pages, which are the primary user interface element in this example. Tab pages that showcase functionality of a specific EJB (such as pg_account and pb_trader in weblogic.pbl) should be implemented as custom class user objects extending pg_base.

The pg_login tab extends pg_base and contains the code (within the cb_login button) to instantiate the JavaVM and to connect to the targeted EJB server.

javavmex is an extension of the JavaVM object in ejbclient100.pbd and thus demonstrates how a PBNI object can be extended within PowerBuilder. The extensions here include functionality to split the current classpath into a string array as well as return the directory from which the Java VM (namely, jvm.dll) was loaded. These functions are used to provide the information displayed in w_jvmstatus whenever the JavaVM button on the 'status bar' of the main window is pressed.

In this example, two custom visual user objects (pg_account and pg_trader) implement the remaining tab pages, and each represents a different EJB. Each tab page declares the JNDI and home interface class name as instance constants and the home interface proxy as an instance variable. The EJB home interface is returned as part of the ue_activate event, which is fired whenever the login process to the application server succeeds. Code to instantiate the remote interface as well as to execute methods on that interface can be found behind the other controls on the tab (buttons, radio buttons, etc.).

Stock Trade Example

The stock trade example demonstrates the invocation of a stateless session bean that returns a Java class (TradeResult) as the return value from a stock purchase or sale.

The list of holdings presented in the external DataWindow is hard-coded and will be refreshed whenever the application is restarted or the user disconnects and reconnects.

The implementation of the bean does not allow trades of over 500 shares; therefore, the PowerBuilder client code tests the number of shares actually traded to see if it matches the request.

Account Example

The account example demonstrates functionality of an entity bean representing bank accounts.

The Retrieve Account List button calls a finder method to return a Java collection of all accounts with a non-negative balance. The code here demonstrates how to deal with Java interfaces within the PowerBuilder client.

The other buttons demonstrate how to create, remove and update entity beans and involve other simple dialogs to provide the necessary input for those operations. NOTE: the implementation of this EJB as provided by BEA does not enforce a primary key (the account number); therefore, the DuplicateKeyException never fires and it is possible to have multiple accounts with the same number.

For more information

For more information, see Application Techniques, Chapter 29, "Building an EJB client". Also look for other PB EJB client samples in CodeXchange, such as a PowerBuilder client accessing JBoss.


Document Info


Accesari: 1689
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright Contact (SCRIGROUP Int. 2024 )