php.java.bridge
Class AppThreadPool.Delegate

java.lang.Object
  extended by java.lang.Thread
      extended by php.java.bridge.ThreadPool.Delegate
          extended by php.java.bridge.AppThreadPool.Delegate
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
AppThreadPool

final class AppThreadPool.Delegate
extends ThreadPool.Delegate

A specialized delegate which can handle persistent connections and interrupts application threads when end() or terminate() is called.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.ThreadGroup appGroup
           
 
Fields inherited from class php.java.bridge.ThreadPool.Delegate
terminate
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected AppThreadPool.Delegate(java.lang.String name)
          Create a new delegate.
 
Method Summary
protected  void createThread(java.lang.String name)
           
protected  void end()
           
 java.lang.ThreadGroup getAppGroup()
          Return the app group for this delegate.
 void setPersistent()
          Make this thread a daemon thread.
protected  void terminate()
           
 
Methods inherited from class php.java.bridge.ThreadPool.Delegate
run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

appGroup

protected java.lang.ThreadGroup appGroup
Constructor Detail

AppThreadPool.Delegate

protected AppThreadPool.Delegate(java.lang.String name)
Create a new delegate. The thread runs until terminatePersistent() is called.

Parameters:
name - The name of the delegate.
Method Detail

getAppGroup

public java.lang.ThreadGroup getAppGroup()
Return the app group for this delegate. All user-created threads live in this group and receive an interrupt (which should terminate them), when the request is done.

Returns:
The application group

setPersistent

public void setPersistent()
Make this thread a daemon thread. A daemon is not visible but still managed by the thread pool.


createThread

protected void createThread(java.lang.String name)
Overrides:
createThread in class ThreadPool.Delegate

terminate

protected void terminate()
Overrides:
terminate in class ThreadPool.Delegate

end

protected void end()
Overrides:
end in class ThreadPool.Delegate