# Class RequestThreadFactory (5.0.3)

    public class RequestThreadFactory implements ThreadFactory

Thread factory creating threads with a request specific thread local environment.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> RequestThreadFactory

## Implements

[ThreadFactory](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadFactory.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### RequestThreadFactory(ApiProxy.Environment requestEnvironment)

    public RequestThreadFactory(ApiProxy.Environment requestEnvironment)

Create a new VmRequestThreadFactory.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `requestEnvironment` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.apphosting.api.ApiProxy.Environment` The request environment to install on each thread. |

## Methods

### getRequestThreads()

    public List<Thread> getRequestThreads()

Returns an immutable copy of the current request thread list.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html>` |   |

### newThread(Runnable runnable)

    public Thread newThread(Runnable runnable)

Create a new [Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html) that executes `runnable` for the duration of the current
request. This thread will be interrupted at the end of the current request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `runnable` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html` The object whose run method is invoked when this thread is started. If null, this classes run method does nothing. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html` |   |