public final class

NewThreadAction

extends Object
implements PrivilegedAction<T>
java.lang.Object
   ↳ sun.rmi.runtime.NewThreadAction

Class Overview

A PrivilegedAction for creating a new thread conveniently with an AccessController.doPrivileged construct. All constructors allow the choice of the Runnable for the new thread to execute, the name of the new thread (which will be prefixed with "RMI "), and whether or not it will be a daemon thread. The new thread may be created in the system thread group (the root of the thread group tree) or an internally created non-system thread group, as specified at construction of this class. The new thread will have the system class loader as its initial context class loader (that is, its context class loader will NOT be inherited from the current thread).

Summary

Public Constructors
NewThreadAction(Runnable runnable, String name, boolean daemon)
Creates an action that will create a new thread in the system thread group.
NewThreadAction(Runnable runnable, String name, boolean daemon, boolean user)
Creates an action that will create a new thread.
Public Methods
Thread run()
Performs the computation.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.security.PrivilegedAction

Public Constructors

public NewThreadAction (Runnable runnable, String name, boolean daemon)

Creates an action that will create a new thread in the system thread group.

Parameters
runnable the Runnable for the new thread to execute
name the name of the new thread
daemon if true, new thread will be a daemon thread; if false, new thread will not be a daemon thread

public NewThreadAction (Runnable runnable, String name, boolean daemon, boolean user)

Creates an action that will create a new thread.

Parameters
runnable the Runnable for the new thread to execute
name the name of the new thread
daemon if true, new thread will be a daemon thread; if false, new thread will not be a daemon thread
user if true, thread will be created in a non-system thread group; if false, thread will be created in the system thread group

Public Methods

public Thread run ()

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

Returns
  • 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.