Skip navigation.

Beehive Integration in WebLogic Server 9.0

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

Beehive Applications


 

 


What Is a Beehive Application?

Beehive is an open source J2EE programming framework designed to make the most difficult J2EE programming tasks easier.

Where the traditional J2EE programmer would use complex APIs and configuration files, the Beehive programmer uses "metadata annotations," also known simply as "annotations." Annotations dramatically simplify the J2EE code and allow non-experts to create J2EE applications. Annotations stand in for common, boilerplate coding tasks. Instead of learning the complex J2EE API, developers can set properties on their code using metadata annotations.

Annotations are a new feature in Java, added in the J2SE 5.0 version of the language. For background information about annotations, please see http://java.sun.com/j2se/1.5.0/index.jsp and http://jcp.org/en/jsr/detail?id=175.

Beehive ships with three main components:

The diagram below shows a typical Beehive application. The application has three basic components:

 


Apache Beehive Documentation

Beehive is a project of the Apache Software Foundation. The version of Beehive that is installed on your computer during the installation of WebLogic Server does not necessarily correspond to the version currently documented on the Apache website. To see the full, current Apache Beehive documentation, refer to http://beehive.apache.org.

A copy of the Beehive documentation from the Apache site is installed on your computer when WebLogic Server is installed. This documentation corresponds to the version of Beehive on your computer. To read this documentation, navigate to

<WEBLOGIC_HOME>\beehive\apache-beehive-incubating-1.0m1\docs\docs 

and double-click on the file index.html in that folder.

Note: The version of Beehive shipped with WebLogic Server 9.0 does not include the web service metadata sub-project. Consequently, the web service metadata documentation has not been included and hyperlinks to the removed documentation content are broken.

 


Running the WebLogic Server/Beehive Integration Samples

Samples Architecture

WebLogic Server contains three interconnected Beehive samples. These samples demonstrate how to build progressively more complex applications based on a simple web service. The simple web service, called creditRatingApp, at the core of these samples takes a nine-digit Social Security number and responds with a credit rating. The remaining two samples are more complex client applications of this basic web service.

These three samples, named creditRatingApp, bankLoanApp, and customerLoanApp, are described in creditRatingApp, bankLoanApp, and customerLoanApp, respectively.

Locating the Samples

The samples documented here are located on your system in

<WEBLOGIC_HOME>\beehive\weblogic-beehive\samples.

creditRatingApp

This sample is a stateless web service (built using JSR 181 web service annotations) that takes a nine-digit Social Security number and responds with a credit worthiness rating. The following two samples are clients of this web service.

bankLoanApp

This sample is an application that evaluates a loan seeking customer. Given the customer's Social Security number, the application will (1) return an interest rate appropriate for that customer's credit rating and (2) decide whether or not a customer should be given a loan of a specified amount.

The application consists of a conversational (stateful) web service consisting of a start and a finish method. The start method takes a Social Security number and returns an interest rate based on the customer's credit rating. The start method acquires the customer's credit rating by calling the creditRatingApp web service described in creditRatingApp. The credit rating is then passed to a local EJB, which calculates the appropriate interest rate.

The finish method determines whether the customer may borrow a specified amount. This method takes a float value and returns a boolean value. This method also checks a database to see if the customer has borrowed money in the past.

Because this application relies on a database connection, to run this application, you must first create the necessary database. Details on creating the necessary database are described in step 3 in Running the bankLoanApp Application.

The Java source for this web service is located at

bankLoanApp\src\services\pkg\bankLoanConversation.java.

customerLoanApp

This sample is a web application interface on the bankLoanApp sample described in bankLoanApp. It provides JSPs from which users can make requests of and view responses from the bankLoanApp.

Running the Beehive Samples

To run the samples, you must first create a Beehive-enabled server domain, then you must build and deploy the three samples in the following order: creditRatingApp, bankLoanApp, customerLoanApp.

Creating a Beehive-enabled Domain

To create a Beehive-enabled server domain, follow these steps:

  1. Start the domain configuration wizard: Start > BEA Products > Tools > Configuration Wizard.
  2. Click Next on each page of the wizard without changing any of the default values, except for the following changes:

    On the second page (labeled Select Domain Source), place a check in the checkbox next to "Apache Beehive."

    On the third page (labeled Configure Administrator Username and Password), in the User password field, enter weblogic.

  3. Start an instance of the new server by running
  4. <BEA_HOME>\user_projects\domains\base_domain\startWebLogic.cmd

    on Windows or

    <BEA_HOME>/user_projects/domains/base_domain/startWebLogic.sh

    on UNIX.

  5. Set up the build environment by opening a command shell and running
  6. <BEA_HOME>\user_projects\domains\base_domain\bin\setDomainEnv.cmd

    on Windows or

    <BEA_HOME>/user_projects/domains/base_domain/bin/setDomainEnv.sh

    on UNIX.

Running the creditRatingApp Web Service

To build and deploy the creditRatingApp:

  1. Navigate to creditRatingApp\src.
  2. Run the following Ant command:
  3. ant clean build pkg.exploded deploy.exploded

Running the bankLoanApp Application

  1. Navigate to bankLoanApp\src.
  2. Run the following Ant command:
  3. ant clean build pkg.exploded deploy.exploded
  4. To create the necessary backend database, visit the URL http://localhost:7001/bankLoanWeb and click the link Create the Table. After the table has been created, click Return to index.
  5. To test the bankLoanApp, enter a nine-digit number in the field marked Get the amount borrowed by SSN and click Submit. The amount previously borrowed by the applicant will be displayed in the server console.

Running the customerLoanApp

To build and deploy the customerLoanApp:

  1. Navigate to customerLoanApp\src.
  2. Run the following Ant command:
  3. ant clean build pkg.exploded deploy.exploded
  4. To test the web application, visit the URL http://localhost:7001/customerLoanWeb.
  5. Enter a nine-digit Social Security number to retrieve an interest rate; then request a loan of a specific amount.

 

Skip navigation bar  Back to Top Previous Next