Jadex 0.96-beta1

jadex.util.concurrent
Class Executor

java.lang.Object
  extended by jadex.util.concurrent.Executor
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
TimerService

public class Executor
extends Object
implements Runnable

A helper class for running a single instance of code using the thread pool. The code to be executed has to be placed in the code() method. Once created, the execute() method may be called as often as desired. When no thread is currently executing the object, a new thread is used from the thread pool. Otherwise, the already existing thread continues execution. After shutdown() is called, the executor stops execution, even when execute() is called afterwards.


Constructor Summary
Executor()
          Create an executor object.
Executor(IExecutable executable)
          Create an executor object.
 
Method Summary
 void execute()
          Make sure a thread is executing the code.
 void resume()
          Resume a task.
 void run()
          Execute the code.
 void shutdown()
          Shutdown the executor.
 void suspend()
          Suspend a task.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Executor

public Executor()
Create an executor object.


Executor

public Executor(IExecutable executable)
Create an executor object.

Method Detail

run

public void run()
Execute the code.

Specified by:
run in interface Runnable

execute

public void execute()
Make sure a thread is executing the code.


suspend

public void suspend()
Suspend a task. The task will not be executed until resume is called.


resume

public void resume()
Resume a task. Triggers the task to be not executed again.


shutdown

public void shutdown()
Shutdown the executor.


Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.