creamtec.webcream.core
Class WebCreamThreadGroup

java.lang.Object
  extended by java.lang.ThreadGroup
      extended by creamtec.webcream.core.WebCreamThreadGroup
All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler

public class WebCreamThreadGroup
extends java.lang.ThreadGroup

WebCream uses its own thread groups to keep track of the threads created by, and of behalf of, the virtual application. It needs it to maintain the association between the thread and the client agent. The thread group also acts as a pool of threads.


Constructor Summary
WebCreamThreadGroup(ClientAgent agent)
          Creates a thread group for the given client agent
 
Method Summary
 WebCreamThread allocateThread()
          Allocate a thread for the given client
 ClientAgent getClientAgent()
          Returns the client agent associated with this thread group
 WebCreamThread getPrimeThread()
          Returns the main thread of this thread group
 void releaseThread(java.lang.Thread thread)
          Puts the thread back into the pool of ready-to-run threads
 void setClientAgent(ClientAgent agent)
          Sets the client agent associated with this thread group
 void setPrimeThread(WebCreamThread thread)
          Sets the main thread of this thread group
 void shutdown()
          Stops all threads
 
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebCreamThreadGroup

public WebCreamThreadGroup(ClientAgent agent)
Creates a thread group for the given client agent

Parameters:
agent - ClientAgent
Method Detail

getClientAgent

public ClientAgent getClientAgent()
Returns the client agent associated with this thread group

Returns:
ClientAgent

setClientAgent

public void setClientAgent(ClientAgent agent)
Sets the client agent associated with this thread group

Parameters:
agent - ClientAgent

getPrimeThread

public WebCreamThread getPrimeThread()
Returns the main thread of this thread group

Returns:
WebCreamThread

setPrimeThread

public void setPrimeThread(WebCreamThread thread)
Sets the main thread of this thread group

Parameters:
thread - WebCreamThread

allocateThread

public WebCreamThread allocateThread()
Allocate a thread for the given client


releaseThread

public void releaseThread(java.lang.Thread thread)
Puts the thread back into the pool of ready-to-run threads

Parameters:
thread - Thread

shutdown

public void shutdown()
Stops all threads



Copyright © 2000-2006 CreamTec LLC. All Rights Reserved.