Top Description Inners Fields Constructors Methods
org.jboss.threads

public final Class JBossThreadFactory

extends Object
implements ThreadFactory
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ThreadFactory
Imports
java.security.AccessController, .PrivilegedAction, .AccessControlContext, java.util.concurrent.ThreadFactory, java.util.concurrent.atomic.AtomicLong

A factory for JBossThread instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final AccessControlContext
creatingContext

Deprecated as a consequence of AccessControlContext being deprecated.
private final Boolean
private final long
private static final AtomicLong
private final AtomicLong
private static final AtomicLong
private final Integer
private final String
private final Long
private final ThreadGroup
private final Thread.UncaughtExceptionHandler

Constructor Summary

AccessConstructor and Description
public
JBossThreadFactory(ThreadGroup
the thread group to assign threads to by default (may be null)
threadGroup
,
final Boolean
whether the created threads should be daemon threads, or null to use the thread group's setting
daemon
,
final Integer
the initial thread priority, or null to use the thread group's setting
initialPriority
,
String
the name pattern string
namePattern
,
final Thread.UncaughtExceptionHandler
the uncaught exception handler, if any
uncaughtExceptionHandler
,
final Long
the JVM-specific stack size, or null to leave it unspecified
stackSize
)

Construct a new instance.

public
JBossThreadFactory(ThreadGroup threadGroup, final Boolean daemon, final Integer initialPriority, String namePattern, final Thread.UncaughtExceptionHandler uncaughtExceptionHandler, final Long stackSize, final AccessControlContext ignored)

Method Summary

Modifier and TypeMethod and Description
private Thread
createThread(final Runnable target)

public Thread
newThread(final Runnable
a runnable to be executed by new thread instance
target
)

Implements java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

creatingContextback to summary
private final AccessControlContext creatingContext

Deprecated

as a consequence of AccessControlContext being deprecated. See corresponding docs for further information.

daemonback to summary
private final Boolean daemon
factoryIndexback to summary
private final long factoryIndex
factoryIndexSequenceback to summary
private static final AtomicLong factoryIndexSequence
factoryThreadIndexSequenceback to summary
private final AtomicLong factoryThreadIndexSequence
globalThreadIndexSequenceback to summary
private static final AtomicLong globalThreadIndexSequence
initialPriorityback to summary
private final Integer initialPriority
namePatternback to summary
private final String namePattern
stackSizeback to summary
private final Long stackSize
threadGroupback to summary
private final ThreadGroup threadGroup
uncaughtExceptionHandlerback to summary
private final Thread.UncaughtExceptionHandler uncaughtExceptionHandler

Constructor Detail

JBossThreadFactoryback to summary
public JBossThreadFactory(ThreadGroup threadGroup, final Boolean daemon, final Integer initialPriority, String namePattern, final Thread.UncaughtExceptionHandler uncaughtExceptionHandler, final Long stackSize)

Construct a new instance. The access control context of the calling thread will be the one used to create new threads if a security manager is installed.

Parameters
threadGroup:ThreadGroup

the thread group to assign threads to by default (may be null)

daemon:Boolean

whether the created threads should be daemon threads, or null to use the thread group's setting

initialPriority:Integer

the initial thread priority, or null to use the thread group's setting

namePattern:String

the name pattern string

uncaughtExceptionHandler:Thread.UncaughtExceptionHandler

the uncaught exception handler, if any

stackSize:Long

the JVM-specific stack size, or null to leave it unspecified

JBossThreadFactoryback to summary
public JBossThreadFactory(ThreadGroup threadGroup, final Boolean daemon, final Integer initialPriority, String namePattern, final Thread.UncaughtExceptionHandler uncaughtExceptionHandler, final Long stackSize, final AccessControlContext ignored)
Annotations
@Deprecated

Method Detail

createThreadback to summary
private Thread createThread(final Runnable target)
newThreadback to summary
public Thread newThread(final Runnable target)

Implements java.util.concurrent.ThreadFactory.newThread.

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

Constructs a new unstarted Thread to run the given runnable.

Parameters
target: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

org.jboss.threads back to summary

private final Class JBossThreadFactory.ThreadCreateAction

extends Object
implements PrivilegedAction<Thread>
Class Inheritance
All Implemented Interfaces
java.security.PrivilegedAction

Field Summary

Modifier and TypeField and Description
private final Runnable

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Thread
run()

Implements java.security.PrivilegedAction.run.

Performs the computation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetback to summary
private final Runnable target

Constructor Detail

ThreadCreateActionback to summary
private ThreadCreateAction(final Runnable target)

Method Detail

runback to summary
public Thread run()

Implements java.security.PrivilegedAction.run.

Doc from java.security.PrivilegedAction.run.

Performs the computation. This method will be called by AccessController.doPrivileged after enabling privileges.

Returns:Thread

a class-dependent value that may represent the results of the computation. Each class that implements PrivilegedAction should document what (if anything) this value represents.