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
(ApiProxy.Environment requestEnvironment) Create a new VmRequestThreadFactory. -
Method Summary
-
Constructor Details
-
RequestThreadFactory
Create a new VmRequestThreadFactory.- Parameters:
requestEnvironment
- The request environment to install on each thread.
-
-
Method Details
-
newThread
Create a newThread
that executesrunnable
for the duration of the current request. This thread will be interrupted at the end of the current request.- Specified by:
newThread
in interfaceThreadFactory
- Parameters:
runnable
- The object whose run method is invoked when this thread is started. If null, this classes run method does nothing.- Throws:
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.
-