Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.emory.mathcs.util.concurrent
Class DelegatedRunnable  view DelegatedRunnable download DelegatedRunnable.java

java.lang.Object
  extended byedu.emory.mathcs.util.concurrent.DelegatedRunnable
All Implemented Interfaces:
java.lang.Runnable

public class DelegatedRunnable
extends java.lang.Object
implements java.lang.Runnable

Wrapper for a runnable that ensures that further executions (even if performed by different threads) inherit current access control context and ThreadContext. In particular, the task will always run with the same access permissions, delegatable thread locals, and context class loader, determined at the time of creation of this DelegatedRunnable.

Version:
1.0

Field Summary
(package private)  java.security.AccessControlContext acc
           
(package private)  java.lang.Runnable runnable
           
(package private)  ThreadContext tc
           
 
Constructor Summary
DelegatedRunnable(java.lang.Runnable runnable)
          Construct new DelegatedRunnable wrapper for a given task.
 
Method Summary
 void run()
          Execute wrapped runnable within access control context and ThreadContext associated to this object at the creation time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runnable

final java.lang.Runnable runnable

acc

final java.security.AccessControlContext acc

tc

final ThreadContext tc
Constructor Detail

DelegatedRunnable

public DelegatedRunnable(java.lang.Runnable runnable)
Construct new DelegatedRunnable wrapper for a given task.

Method Detail

run

public void run()
Execute wrapped runnable within access control context and ThreadContext associated to this object at the creation time. In particular, the task will run with the same access permissions, delegatable thread locals, and context class loader, as seen when this object was created.

Specified by:
run in interface java.lang.Runnable