Package com.sun.jini.thread
Class NewThreadAction
java.lang.Object
com.sun.jini.thread.NewThreadAction
- All Implemented Interfaces:
PrivilegedAction
A PrivilegedAction for creating a new thread conveniently with an AccessController.doPrivileged
or Security.doPrivileged.
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 the constant NAME_PREFIX), 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).
- Author:
- Sun Microsystems, Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionNewThreadAction(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. -
Method Summary
-
Constructor Details
-
NewThreadAction
Creates an action that will create a new thread in the system thread group.- Parameters:
runnable- the Runnable for the new thread to executename- the name of the new threaddaemon- if true, new thread will be a daemon thread; if false, new thread will not be a daemon thread
-
NewThreadAction
Creates an action that will create a new thread.- Parameters:
runnable- the Runnable for the new thread to executename- the name of the new threaddaemon- if true, new hread will be a daemon thread; if false, new thread will not be a daemon threaduser- if true, thread will be created in a non-system thread group; if false, thread will be created in the system thread group
-
-
Method Details
-
run
- Specified by:
runin interfacePrivilegedAction
-