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

Quick Search    Search Deep

org.ematgine.utils.concurrent
Class LockedExecutor  view LockedExecutor download LockedExecutor.java

java.lang.Object
  extended byorg.ematgine.utils.concurrent.LockedExecutor
All Implemented Interfaces:
Executor

public class LockedExecutor
extends java.lang.Object
implements Executor

An implementation of Executor that invokes the run method of the supplied command within a synchronization lock and then returns.

[ Introduction to this package. ]


Field Summary
protected  Sync mutex_
          The mutex
 
Constructor Summary
LockedExecutor(Sync mutex)
          Create a new LockedExecutor that relies on the given mutual exclusion lock.
 
Method Summary
 void execute(java.lang.Runnable command)
          Execute the given command directly in the current thread, within the supplied lock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mutex_

protected final Sync mutex_
The mutex

Constructor Detail

LockedExecutor

public LockedExecutor(Sync mutex)
Create a new LockedExecutor that relies on the given mutual exclusion lock.

Method Detail

execute

public void execute(java.lang.Runnable command)
             throws java.lang.InterruptedException
Execute the given command directly in the current thread, within the supplied lock.

Specified by:
execute in interface Executor