Package com.google.appengine.setup
Class RequestThreadFactory
java.lang.Object
com.google.appengine.setup.RequestThreadFactory
- All Implemented Interfaces:
ThreadFactory
Thread factory creating threads with a request specific thread local environment.
-
Constructor Summary
ConstructorsConstructorDescriptionRequestThreadFactory(com.google.apphosting.api.ApiProxy.Environment requestEnvironment) Create a new VmRequestThreadFactory. -
Method Summary
-
Constructor Details
-
RequestThreadFactory
public RequestThreadFactory(com.google.apphosting.api.ApiProxy.Environment requestEnvironment) Create a new VmRequestThreadFactory.- Parameters:
requestEnvironment- The request environment to install on each thread.
-
-
Method Details
-
newThread
Create a newThreadthat executesrunnablefor the duration of the current request. This thread will be interrupted at the end of the current request.- Specified by:
newThreadin interfaceThreadFactory- Parameters:
runnable- The object whose run method is invoked when this thread is started. If null, this classes run method does nothing.- Throws:
com.google.apphosting.api.ApiProxy.ApiProxyException- If called outside of a running request.IllegalStateException- If called after the request thread stops.
-
getRequestThreads
Returns an immutable copy of the current request thread list.
-