| java.lang.Object org.apache.harmony.rmi.common.CreateThreadAction
CreateThreadAction | public class CreateThreadAction implements PrivilegedAction(Code) | | Action for privileged Threads creation.
There are 2 ThreadGroups used in RMI runtime:
1) System ThreadGroup, i.e. the topmost non-null ThreadGroup. All RMI
internal threads are created in this group
2) Non-system ThreadGroup, i.e. the child of the system ThreadGroup. There
are 2 cases when the thread is created in this group:
a) When the remote call is accepted on the server side
b) When the unreferenced thread is started
There are 2 reasons why 2 threads are needed:
1) If we create all threads in the system ThreadGroup than if the
implementation of remote method has the code starting the new thread,
we'll get AccessControllException requiring
java.lang.RuntimePermission("modifyThreadGroup") and
java.lang.RuntimePermission("modifyThread") permissions because it's not
allowed by default to create a new thread in the system group
2) If we create all threads (including RMI internal ones) in non-system
ThreadGroup then the malicious code could potentially interrupt RMI
internal threads by using Thread.enumerate() static method.
author: Mikhail A. Markov version: $Revision: 1.1.2.2 $ |
Method Summary | |
public Object | run() Creates the thread. |
CreateThreadAction | public CreateThreadAction(Runnable r, String name, boolean isDaemon)(Code) | | Constructs CreateThreadAction to create a new Thread in the system
ThreadGroup.
Parameters: r - Runnable object for Thread creation Parameters: name - name of thread to be created Parameters: isDaemon - true if thread to be created should be a daemon |
CreateThreadAction | public CreateThreadAction(Runnable r, String name, boolean isDaemon, boolean isSystem)(Code) | | Constructs CreateThreadAction to create Thread.
Parameters: r - Runnable object for Thread creation Parameters: name - name of thread to be created Parameters: isDaemon - true if thread to be created should be a daemon Parameters: isSystem - true if system ThreadGroup should be used and falseotherwise |
run | public Object run()(Code) | | Creates the thread.
started thread |
|
|