Top Description Fields Constructors Methods
org.jruby.threading

public Class DaemonThreadFactory

extends Object
implements ThreadFactory
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ThreadFactory
Imports
java.util.concurrent.ThreadFactory, java.util.concurrent.atomic.AtomicInteger

A ThreadFactory for when we're using pooled threads; we want to create the threads with daemon = true so they don't keep us from shutting down.

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
public
DaemonThreadFactory(String name, int priority)

public

Method Summary

Modifier and TypeMethod and Description
public Thread
newThread(Runnable
a runnable to be executed by new thread instance
runnable
)

Implements java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private final AtomicInteger count
nameback to summary
private final String name
priorityback to summary
private final int priority

Constructor Detail

DaemonThreadFactoryback to summary
public DaemonThreadFactory(String name)
DaemonThreadFactoryback to summary
public DaemonThreadFactory(String name, int priority)
DaemonThreadFactoryback to summary
public DaemonThreadFactory()

Method Detail

newThreadback to summary
public Thread newThread(Runnable runnable)

Implements java.util.concurrent.ThreadFactory.newThread.

Doc from java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.

Parameters
runnable:Runnable

a runnable to be executed by new thread instance

Returns:Thread

constructed thread, or null if the request to create a thread is rejected