org.apache.geronimo.samples.daytrader.client.ws
Class ClientScenario

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.apache.geronimo.samples.daytrader.client.ws.ClientScenario
All Implemented Interfaces:
java.lang.Runnable

public class ClientScenario
extends java.lang.Thread

Web Services J2EE client for Trade.


Field Summary
static java.lang.String symbol
           
protected static boolean useJNDI
          A flag to determine how to get the port.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientScenario()
           
ClientScenario(int reqPerThreadIn)
           
 
Method Summary
protected  long clearStats()
           
static long getIntervalStartTime()
          Returns the intervalStartTime.
static long getMaxResp()
          Returns the maxResp.
static long getMinResp()
          Returns the minResp.
 long getNumErrs()
          Returns the numErrs.
 long getNumReqs()
          Returns the numReqs.
 long getNumStatReqs()
          Returns the numStatReqs.
static long getNumThreads()
          Returns the numThreads.
static long getReqPerThread()
          Returns the reqPerThread.
static java.lang.String getServicePort()
          Returns the servicePort.
static long getStartTime()
          Returns the startTime.
static long getStatStartTime()
          Returns the statStartTime.
static long getTotalNumRequests()
          Returns the totalNumRequests.
static long getTotReqsAtLastInterval()
          Returns the totReqsAtLastInterval.
 long getTotResp()
          Returns the totResp.
protected static TradeWSServices getTrade()
          Get a web services port that represents the Trade services.
static TradeWSServices getTradeSingleton()
           
 boolean isStop()
          Returns the stop.
 void run()
           
static void setIntervalStartTime(long intervalStartTime)
          Sets the intervalStartTime.
static void setMaxResp(long maxResp)
          Sets the maxResp.
static void setMinResp(long minResp)
          Sets the minResp.
 void setNumErrs(long numErrs)
          Sets the numErrs.
 void setNumReqs(long numReqs)
          Sets the numReqs.
 void setNumStatReqs(long numStatReqs)
          Sets the numStatReqs.
static void setNumThreads(long numThreads)
          Sets the numThreads.
static void setReqPerThread(long reqPerThread)
          Sets the reqPerThread.
static void setServicePort(java.lang.String servicePort)
          Sets the servicePort.
static void setStartTime(long startTime)
          Sets the startTime.
static void setStatStartTime(long statStartTime)
          Sets the statStartTime.
 void setStop(boolean stop)
          Sets the stop.
static void setTotReqsAtLastInterval(long totReqsAtLastInterval)
          Sets the totReqsAtLastInterval.
 void setTotResp(long totResp)
          Sets the totResp.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useJNDI

protected static final boolean useJNDI
A flag to determine how to get the port. If true, use JNDI lookup to get a Service. To use a ServiceFactory to obtain a Service, set useJNDI false. If useJNDI is true, the client must be run in a J2EE client container.

See Also:
Constant Field Values

symbol

public static java.lang.String symbol
Constructor Detail

ClientScenario

public ClientScenario()

ClientScenario

public ClientScenario(int reqPerThreadIn)
Method Detail

run

public void run()

clearStats

protected long clearStats()

getTrade

protected static TradeWSServices getTrade()
                                   throws javax.xml.rpc.ServiceException,
                                          java.net.MalformedURLException
Get a web services port that represents the Trade services. First try JSR 109 lookup, then fall back on error to JSR 101.

Returns:
Trade Services Interface
Throws:
javax.xml.rpc.ServiceException - if accessing the service or port fails.
java.net.MalformedURLException - if an invalid URL is obtained.

getTradeSingleton

public static TradeWSServices getTradeSingleton()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getIntervalStartTime

public static long getIntervalStartTime()
Returns the intervalStartTime.

Returns:
long

getMaxResp

public static long getMaxResp()
Returns the maxResp.

Returns:
long

getMinResp

public static long getMinResp()
Returns the minResp.

Returns:
long

getNumThreads

public static long getNumThreads()
Returns the numThreads.

Returns:
long

getReqPerThread

public static long getReqPerThread()
Returns the reqPerThread.

Returns:
long

getStartTime

public static long getStartTime()
Returns the startTime.

Returns:
long

getStatStartTime

public static long getStatStartTime()
Returns the statStartTime.

Returns:
long

getTotReqsAtLastInterval

public static long getTotReqsAtLastInterval()
Returns the totReqsAtLastInterval.

Returns:
long

getNumErrs

public long getNumErrs()
Returns the numErrs.

Returns:
long

getNumReqs

public long getNumReqs()
Returns the numReqs.

Returns:
long

isStop

public boolean isStop()
Returns the stop.

Returns:
boolean

getTotResp

public long getTotResp()
Returns the totResp.

Returns:
long

setIntervalStartTime

public static void setIntervalStartTime(long intervalStartTime)
Sets the intervalStartTime.

Parameters:
intervalStartTime - The intervalStartTime to set

setMaxResp

public static void setMaxResp(long maxResp)
Sets the maxResp.

Parameters:
maxResp - The maxResp to set

setMinResp

public static void setMinResp(long minResp)
Sets the minResp.

Parameters:
minResp - The minResp to set

setNumThreads

public static void setNumThreads(long numThreads)
Sets the numThreads.

Parameters:
numThreads - The numThreads to set

setReqPerThread

public static void setReqPerThread(long reqPerThread)
Sets the reqPerThread.

Parameters:
reqPerThread - The reqPerThread to set

setStartTime

public static void setStartTime(long startTime)
Sets the startTime.

Parameters:
startTime - The startTime to set

setStatStartTime

public static void setStatStartTime(long statStartTime)
Sets the statStartTime.

Parameters:
statStartTime - The statStartTime to set

setTotReqsAtLastInterval

public static void setTotReqsAtLastInterval(long totReqsAtLastInterval)
Sets the totReqsAtLastInterval.

Parameters:
totReqsAtLastInterval - The totReqsAtLastInterval to set

setNumErrs

public void setNumErrs(long numErrs)
Sets the numErrs.

Parameters:
numErrs - The numErrs to set

setNumReqs

public void setNumReqs(long numReqs)
Sets the numReqs.

Parameters:
numReqs - The numReqs to set

setStop

public void setStop(boolean stop)
Sets the stop.

Parameters:
stop - The stop to set

setTotResp

public void setTotResp(long totResp)
Sets the totResp.

Parameters:
totResp - The totResp to set

getTotalNumRequests

public static long getTotalNumRequests()
Returns the totalNumRequests.

Returns:
long

getNumStatReqs

public long getNumStatReqs()
Returns the numStatReqs.

Returns:
long

setNumStatReqs

public void setNumStatReqs(long numStatReqs)
Sets the numStatReqs.

Parameters:
numStatReqs - The numStatReqs to set

getServicePort

public static java.lang.String getServicePort()
Returns the servicePort.

Returns:
String

setServicePort

public static void setServicePort(java.lang.String servicePort)
Sets the servicePort.

Parameters:
servicePort - The servicePort to set


Copyright © 2005-2006 Apache Software Foundation. All Rights Reserved.