Apache Stonehenge > Index > Stonehenge StockTrader Sample Application > Stonehenge Metro StockTrader Documentation > Stonehenge Metro StockTrader Installation Guide
Added by Nicholas A Hauenstein, last edited by Nicholas A Hauenstein on Oct 15, 2009  (view change) show comment
Warning

This page is a draft, its content is not complete and might contain errors.

Overview

This document is meant to serve as a guide for installing the Metro version of the Stonehenge StockTrader Sample Application. It also includes a series of test cases that you can work through to demonstrate interoperability with other implementations of the application.

Table of Contents





Vocabulary

Alias Meaning
STOCKTRADER_HOME The directory where you check out the source code from SVN Repository to, and should contains sub-directories business_service and order_processor
AS_HOME The root directory of GlassFish server
DOTNET_STOCKTRADER_HOME The root directory of .NET StockTrader
BS StockTrader Business Service
OP StockTrader Order Processor Service

Metro StockTrader Deployment

Prerequisites

  1. Update JCE settings
    1. Go to http://java.sun.com/javase/downloads/?intcmp=1281
    2. Download Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6
    3. Extract the files included in jce_policy-6.zip in the %JAVA_HOME%\jre\lib\security directory, overwriting the files already present in the directory.
      Note

      If you use JDK 1.5, you will need to install the files for JDK 1.5

  2. Check Out StockTrader Source Code
    1. Check out the Metro implementation of the StockTrader sample application from http://svn.apache.org/repos/asf/incubator/stonehenge/trunk/stocktrader/metro/.
      Note

      You can use the following command to accomplish this task:

      svn co http://svn.apache.org/repos/asf/incubator/stonehenge/trunk/stocktrader/metro/ STOCKTRADER_HOME

  3. Add Dependent JAR Files to StockTrader
    1. Create a lib folder under STOCKTRADER_HOME, and then download the dependencies listed in the README.TXT file in the STOCKTRADER_HOME directory.
  4. Install GlassFish
    1. Download GlassFish 2.1 from http://glassfish.dev.java.net/
    2. Install GlassFish
      Note

      Once you have downloaded GlassFish, you can use the following commands to accomplish this task:

      java -jar glassfish.jar
      cd glassfish
      lib\ant\bin\ant -f setup.xml

      Replace glassfish.jar with the name of the JAR file downloaded.

  5. Set Environment Variables
    1. Set AS_HOME to the root directory of the glassfish installation.
  6. Set the Address of the StockTrader Configuration Service
    1. Open the file STOCKTRADER_HOME\resources\conf\TradeServiceConfig.properties
    2. Change the value of org.apache.stonehenge.stocktrader.TradeConfigService.url to the endpoint address of the configuration service that will be used.
      Note

      You could use the configuration service from either the Metro or .NET implementation.

  7. Configure the Database Properties
    1. Open the file STOCKTRADER_HOME\resources\conf\db.properties
    2. Modify the values of the properties contained within to be appropriate for your target environment.

Deployment

  1. Deploy the StockTrader Application
    Note

    You can use the following command to accomplish this task:

    STOCKTRADER_HOME\ant deploy

    This assumes that you have installed Apache Ant, and have added its bin directory to the path.

  2. Start GlashFish Server
    Note

    You can use the following command to accomplish this task:

    %AS_HOME%\bin\asadmin.bat start-domain

    By default GlassFish Server will be set up to listen on port 8080. You will have to reconfigure GlassFish to listen instead on port 8090. This can be configured by accessing the GlassFish Administration Console and logging in using the user name admin and the password adminadmin.

  3. Verify Deployment
    1. To verify deployment of the BS, access http://localhost:8090/business_service/TradeServiceWsas?wsdl
    2. To verify deployment of the OP, access http://localhost:8090/order_processor/OrderProcessor?wsdl, and http://localhost:8090/order_processor/OrderProcessorSec?wsdl
    3. To verify deployment of the Configuration Service, access http://localhost:8090/config_service/ConfigService?wsdl
    4. To verify deployment of the UI Client, access http://localhost:8090/trader_client

Metro StockTrader Configuration

The Metro Services are managed through the StockTradeDB database. After you run the MSSQL database scripts, you will have four new tables (DBCONFIG, CLIENTTOBS, BSTOOPS, and SERVICE), which are used to configure the services for Metro.

Before you change the CLIENTTOBS and BSTOOPS configuration, open the SERVICE table and verify that the endpoint addresses are accurate for your environment. For this walk-through you will need to have the following endpoints:

Service Name Default Value
DOTNET_BS http://localhost:9000/TradeBusinessService
DOTNET_OPS http://localhost:8000/TradeOrderProcessor
DOTNET_OPSSEC http://localhost:8000/TradeOrderProcessor/sec
METRO_BS http://localhost:8090/business_service/TradeServiceWsas
METRO _OPS http://localhost:8090/order_processor/OrderProcessor
METRO _OPSSEC http://localhost:8090/order_processor/OrderProcessorSec
PHP_BS http://localhost:8080/php_stocktrader/business_service/business_svc.php
PHP_OPS http://localhost:8080/php_stocktrader/order_processor/order_processor_svc.php
PHP_OPSSEC http://localhost:8080/php_stocktrader/order_processor/order_processor_svc_msec.php
WSAS_BS http://localhost:9763/services/TradeServiceWsas
WSAS_OPS http://localhost:9763/services/OrderProcessor
WSAS_OPSSEC http://localhost:9763/services/OrderProcessorMsec
Note 1

For METRO_BS, METRO_OPS and METRO_OPSSEC, you should change the endpoint addresses according to the GlassFish development environment, making sure to include the correct port.

Note 2

In the SERVICE table, please insert service names and addresses for WSAS, including WSAS_BS, WSAS_OPS and WSAS_OPSSEC.

To configure the Services of BS and OPS

  1. Open the Metro StockTrader Client by accessing http://localhost:8090/trader_client.
  2. In the Toolbar, click the Config tab to access the Configuration Page.
  3. Select the corresponding BS and OPS, and then click the Set button.

Test Scenario

  1. Login to the StockTrader Client UI
  2. Click the Quotes/Trade tab in the toolbar.
  3. Choose a stock, and then in the Trade column, click the Buy link for that stock.
  4. Enter a quantity of 112 for Number of Shares, and then click Buy
  5. A submitted for processing message should be received.
  6. Click the Account tab in the toolbar.
    Note
    If the OPS has processed the order, a Trade Alert should be appear

Test Cases

  1. JSF Client as StockTrader UI to Talk to Specific Version of BS

    Set the BS and OPS to the version to be used in Config page.

  2. Metro StockTrader as BS and OP via BasicHttpBinding

    Set the BS and OPS as METRO_BS and METRO_OPS

  3. Metro StockTrader as BS and OP via CustomBinding

    Set the BS and OPS as METRO_BS and METRO_OPSSEC

  4. Metro StockTrader as BS and .NET StockTrader as OP via BasicHttpBinding

    Set the BS and OPS as METRO_BS and DOTNET_OPS

  5. Metro StockTrader as BS and .NET StockTrader as OP via CustomBinding

    Set the BS and OPS as METRO_BS and DOTNET_OPSSEC

  6. Metro StockTrader as BS and WSAS StockTrader as OP via BasicBinding

    Set the BS and OPS as METRO_BS and WSAS_OPS

  7. Metro StockTrader as BS and WSAS StockTrader as OP via CustomBinding

    Set the BS and OPS as METRO_BS and WSAS_OPSSEC

  8. Metro StockTrader as BS and PHP StockTrader as OP via BasicBinding

    Set the BS and OPS as METRO_BS and PHP_OPS

  9. Metro StockTrader as BS and PHP StockTrader as OP via CustomBinding

    Set the BS and OPS as METRO_BS and METRO_OPSSEC

  10. .NET StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding

    Set the BS and OPS as DOTNET_BS and METRO_OPS

  11. .NET StockTrader as BS and Metro StockTrader as OP via CustomBinding

    Set the BS and OPS as DOTNET_BS and METRO_OPSSEC

  12. WSAS StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding

    Set the BS and OPS as WSAS_BS and METRO_OPS

  13. WSAS StockTrader as BS and Metro StockTrader as OP via CustomBinding

    Set the BS and OPS as WSAS_BS and METRO_OPSSEC

  14. PHP StockTrader as BS and Metro StockTrader as OP via BasicHttpBinding

    Set the BS and OPS as PHP_BS and METRO_OPS

  15. PHP StockTrader as BS and Metro StockTrader as OP via CustomBinding

    Set the BS and OPS as PHP_BS and METRO_OPSSEC

  16. .Net StrockTrader use Metro version config service

    Set config service endpoint address to metro version config service.