Jadex 0.96-beta1

jadex.util.concurrent
Class TimerService

java.lang.Object
  extended by jadex.util.concurrent.Executor
      extended by jadex.util.concurrent.TimerService
All Implemented Interfaces:
ITimerService, Runnable

public class TimerService
extends Executor
implements ITimerService

Active timing object for standalone platform. Calls timed object as requested.


Constructor Summary
TimerService()
          Create a new timer.
 
Method Summary
 void addEntry(ITimedObject to, long time)
          Add a timing entry.
 boolean code()
          The code to run on the timer thread.
 void execute()
          Make sure a thread is executing the code.
 void removeEntry(ITimedObject to)
          Remove a timing entry.
 void shutdown()
          Shutdown the executor.
 
Methods inherited from class jadex.util.concurrent.Executor
resume, run, suspend
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerService

public TimerService()
Create a new timer.

Method Detail

addEntry

public void addEntry(ITimedObject to,
                     long time)
Add a timing entry.

Specified by:
addEntry in interface ITimerService
Parameters:
to - The timed object to notify.
time - The absolute wakeup time.

removeEntry

public void removeEntry(ITimedObject to)
Remove a timing entry.

Specified by:
removeEntry in interface ITimerService
Parameters:
to - The object to notify.

code

public boolean code()
The code to run on the timer thread.

Returns:
True, when execution should continue.

execute

public void execute()
Make sure a thread is executing the code. Notify thread to resume execution when entry is added while thread is waiting.

Overrides:
execute in class Executor

shutdown

public void shutdown()
Shutdown the executor.

Specified by:
shutdown in interface ITimerService
Overrides:
shutdown in class 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.