Configuring Domains and Servers
Tutorial 3: Setting Up WebLogic Server Resources for the MedRecServer
This tutorial describes how to set up the WebLogic Server resources required to deploy and run the MedRec application. The tutorial sets up resources for the MedRecServer. These resources include:
Note: This tutorial configures the MedRecServer, and not the PhysicianServer.
The tutorial includes the following sections:
Prerequisites
Before starting this tutorial:
Procedure
Follow these steps to configure WebLogic Server resources for the MedRec Server:
Step 1: Invoke the Administration Console for MedRecServer in your browser.
You use the Administration Console to create the WebLogic Server resources used by the MedRec application suite.
- Enter the following URL in your browser:
http://host:7101/console
where host is the computer on which you have installed the MedRec domains and servers.
- Enter weblogic as the username and password, then click Sign In.
Step 2: Create a JDBC connection pool.
This JDBC connection pool uses a JDBC driver that does not support distributed transactions (non-XA).
- In the left pane of the Administration Console, open Services-> JDBC.
- Right-click Connection Pools and choose Configure a new JDBCConnectionPool.
- Choose Pointbase for the Database Type.
- Choose Pointbase's Driver Versions:4.2 for the Database Driver.
- Click Continue.
- Enter MedRecPool in the Name field.
- Enter demo in the Database Name field.
- Enter the name of the computer that is hosting Pointbase in the Host Name field.
- Enter 9092 in the Port field.
- Enter MedRec in the Database User Name field.
- Enter MedRec in the Password field.
- Click Continue.
- Ensure that the information to test the connection to the Pointbase database is correct, then click Test Connection.
- After verifying that the connection succeeded, click Create and Deploy Pool.
Step 3: Create a JDBC DataSource.
Client and server-side JDBC applications obtain a DBMS connection through a DataSource. A DataSource is an interface between an application and the JDBC connection pool.
- In the left pane of the Administration Console, open Services-> JDBC.
- Right-click Data Sources and choose Configure a new JDBCDataSource.
- Enter Medical Records Tx DataSource in the Name field.
- Enter MedRecTxDataSource in the JNDI Name field.
- Ensure that Honor Global Transactions is checked.
- Click Continue.
- Choose MedRecPool in the Pool Name list box.
- Click Create.
Step 4: Create a JMS JDBC store factory.
A JMS JDBC store consists of a JDBC database that can be used for persistent messaging.
- In the left pane of the Administration Console, open Services-> JMS.
- Right-click Stores and choose Configure a new JMSJDBCStore.
- Enter MedRecJDBCStore in the Name field.
- Choose MedRecPool in the Connection Pool list box.
- Enter MedRec in the Prefix Name field.
- Click Create.
Step 5: Create a JMS server.
A JMS server manages connections and message requests on behalf of JMS clients.
- In the left pane of the Administration Console, open Services-> JMS.
- Right-click Servers and choose Configure a new JMSServer.
- Enter MedRecJMSServer in the Name field.
- Choose MedRecJDBCStore in the Store list box.
- Click Create.
- Choose MedRecServer from the Server list box.
- Click Apply.
Step 6: Create a JMS queue.
JMS queues are based on the point-to-point (PTP) messaging model, which enables the delivery of a message to exactly one recipient. A queue sender (producer) sends a message to a specific queue. A queue receiver (consumer) receives messages from a specific queue.
- In the left pane of the Administration Console, open Services-> JMS->Servers->MedRecJMSSserver.
- Right-click Destinations and choose Configure a new JMSQueue.
- Enter Registration Queue in the Name field.
- Enter jms/REGISTRATION_MDB_QUEUE in the JNDI Name field.
- Click Create.
Step 7: Create a JMS connection factory.
Connection factories are objects that enable JMS clients to create JMS connections. A connection factory supports concurrent use, enabling multiple threads to access the object simultaneously.
- In the left pane of the Administration Console, open Services-> JMS.
- Right-click the Connection Factories node and choose Configure a new JMS ConnectionFactory.
- Enter Queue in the Name field.
- Enter jms/QueueConnectionFactory in the JNDI Name field.
- Click Create.
- Select MedRecServer under the Independent Servers box.
- Click Apply.
- Select the Configuration tab.
- Click the XA Connection Factory Enabled check box.
- Click Apply.
Step 8: Add email capabilities to the MedRec application.
WebLogic Server includes the JavaMail API version 1.1.3 reference implementation from Sun Microsystems. Using the JavaMail API, you can add email capabilities to your WebLogic Server applications. To configure JavaMail for use in WebLogic Server, you create a Mail Session in the WebLogic Server Administration Console. A mail session allows server-side components and applications to access JavaMail services with JNDI, using Session properties you preconfigure for them.
- In the left pane of the Administration Console, open Services.
- Right-click the Mail node and choose Configure a new MailSession.
- Enter Medical Records Mail Session in the Name field.
- Enter mail/MedRecMailSession in the JNDIName field.
- Enter mail.user=joe;mail.host=mail.mycompany.com in the Properties text field.
- Click Create.
- If not already there, move MedRecServer from the Available Servers box to the Targeted Servers box.
- Click Apply.
Best Practices
The Big Picture
The MedRec application uses JMS to create a new patient record. The asynchronous nature of JMS allows the task to be queued and completed later while the user continues with another task.
After the user clicks Create on the Web page to register a new patient, a JMS message is created and put on the REGISTRATION_MDB_QUEUE JMS queue. The RegistrationEJB message-driven bean takes the message off the queue and persists the new patient data to the database using an instance of the PatientEJB entity bean. The PatientEJB entity bean uses the JDBC DataSource to connect to the Pointbase database.
The MedRec application uses other entity beans to persist additional data to the database; for details, see Patient, Physician, and Administrator Data.
The MedRec application uses persistent JMS messaging, which means that the new patient JMS messages that are put on the queue are also stored in a Pointbase database so that the messages can be retrieved in case a problem occurs (such as a server crash) before the message-driven bean is able to process them. The application uses the JMS JDBC store to connect to and update the JMS tables in the Pointbase database.
Related Reading
|
Copyright © 2002 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
|