org.drools.concurrent
Class ExternalExecutorService.ObservableRunnable

java.lang.Object
  extended by org.drools.concurrent.ExternalExecutorService.ObservableRunnable
All Implemented Interfaces:
Runnable, ExternalExecutorService.ObservableTask
Enclosing class:
ExternalExecutorService

protected static final class ExternalExecutorService.ObservableRunnable
extends Object
implements Runnable, ExternalExecutorService.ObservableTask

This class is a wrapper around a Runnable task that will notify a listener when the task starts executing and when it finishes executing.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.drools.concurrent.ExternalExecutorService.ObservableTask
ExternalExecutorService.ObservableTask.TaskType
 
Constructor Summary
ExternalExecutorService.ObservableRunnable(Runnable delegate, ExternalExecutorService.TaskObserver handler)
           
 
Method Summary
 void cancel()
          Prevents the execution of the ObservableTask if it did not started executing yet.
 ExternalExecutorService.ObservableTask.TaskType getType()
          Returns the type of this ObservableTask: either RUNNABLE or CALLABLE
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalExecutorService.ObservableRunnable

public ExternalExecutorService.ObservableRunnable(Runnable delegate,
                                                  ExternalExecutorService.TaskObserver handler)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

getType

public ExternalExecutorService.ObservableTask.TaskType getType()
Description copied from interface: ExternalExecutorService.ObservableTask
Returns the type of this ObservableTask: either RUNNABLE or CALLABLE

Specified by:
getType in interface ExternalExecutorService.ObservableTask
Returns:

cancel

public void cancel()
Description copied from interface: ExternalExecutorService.ObservableTask
Prevents the execution of the ObservableTask if it did not started executing yet.

Specified by:
cancel in interface ExternalExecutorService.ObservableTask


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.