WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.cluster.ejb
Class Client

java.lang.Object
  |
  +--examples.cluster.ejb.Client

public class Client
extends java.lang.Object

This class illustrates load balancing and failover using a container-managed JDBC EntityBean. You'll need to have a properly configured database with the appropriate tables loaded before running this example. This class has the following cycle:

The client demonstrates:

Author:
Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.

Inner Class Summary
(package private)  class Client.Balance
          Performs a balance lookup.
(package private)  class Client.Deposit
          Performs a deposit.
(package private)  class Client.Transaction
          Inner class that is used to call the transactions with the session beans.
(package private)  class Client.Transfer
          Performs a transfer.
(package private)  class Client.Withdrawal
          Performs a withdrawal.
 
Field Summary
(package private) static java.lang.String account1
           
(package private) static java.lang.String account2
           
(package private) static TellerHome bank
           
(package private) static int i
           
(package private) static int ITERATIONS
           
(package private) static int MAXATTEMPTS
           
(package private) static int SLEEP
           
(package private) static ClusterUtils stats
           
(package private) static Teller teller
           
(package private) static int trans
           
(package private) static java.lang.String url
           
 
Constructor Summary
(package private) Client()
           
 
Method Summary
static javax.naming.Context getInitialContext()
          Gets an initial context for the URL.
static void main(java.lang.String[] args)
          Runs this example from the command line.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

account1

static java.lang.String account1

account2

static java.lang.String account2

bank

static TellerHome bank

i

static int i

ITERATIONS

static int ITERATIONS

MAXATTEMPTS

static final int MAXATTEMPTS

SLEEP

static final int SLEEP

stats

static ClusterUtils stats

teller

static Teller teller

trans

static int trans

url

static java.lang.String url
Constructor Detail

Client

Client()
Method Detail

getInitialContext

public static javax.naming.Context getInitialContext()
                                              throws java.lang.Exception
Gets an initial context for the URL.
Returns:
Context
Throws:
java.lang.Exception - if there is an error in getting the Context

main

public static void main(java.lang.String[] args)
Runs this example from the command line. For example:

java examples.cluster.ejb.Client "t3://localhost:7001"

The parameters are optional, but if any are supplied, they are interpreted in this order:

Parameters:
url - URL such as "t3://localhost:7001" of a Server or Cluster

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.