public final class NewThreadAction extends Object implements PrivilegedAction
Modifier and Type | Field and Description |
---|---|
private boolean |
daemon |
private static Permission |
getClassLoaderPermission |
private ThreadGroup |
group |
private String |
name |
(package private) static String |
NAME_PREFIX |
private Runnable |
runnable |
(package private) static ThreadGroup |
systemThreadGroup
cached reference to the system (root) thread group
|
(package private) static ThreadGroup |
userThreadGroup
special child of the system thread group for running tasks that
may execute user code, so that the security policy for threads in
the system thread group will not apply
|
Constructor and Description |
---|
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.
|
NewThreadAction(ThreadGroup group,
Runnable runnable,
String name,
boolean daemon) |
static final String NAME_PREFIX
static final ThreadGroup systemThreadGroup
static final ThreadGroup userThreadGroup
private static final Permission getClassLoaderPermission
private final ThreadGroup group
private final Runnable runnable
private final String name
private final boolean daemon
NewThreadAction(ThreadGroup group, Runnable runnable, String name, boolean daemon)
public NewThreadAction(Runnable runnable, String name, boolean daemon)
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 threadpublic NewThreadAction(Runnable runnable, String name, boolean daemon, boolean user)
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 threaduser
- if true, thread will be created in a non-system
thread group; if false, thread will be created in the system
thread grouppublic Object run()
run
in interface PrivilegedAction
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.