|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.Trigger
public class Trigger
A trigger is an object that runs in a separate thread and waits for
a specified time until it calls a specific method of a trigger client
(see TriggerClient).
Before it actually calls the client's triggerdBy() method it
checks the client's canBeTriggered() method that allows it
or not.
After the client's triggerdBy() method was called the trigger
waits again until the end of its waiting period.
| Method Summary | |
|---|---|
java.lang.String |
getName()
Returns the name of the trigger |
static Trigger |
launch(java.lang.String name,
TriggerClient client,
long intervalInMs)
Launch a new trigger with the given name for the given client, that calls the triggeredBy method of the client every intervalInMs milliseconds. |
void |
run()
Implementation of Runnable. |
void |
terminate()
Terminates the trigger. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String getName()
public static Trigger launch(java.lang.String name,
TriggerClient client,
long intervalInMs)
name - The name of the trigger (must not be null)client - The client that gets triggered (must not be null)intervalInMs - The interval after that the client regularily gets triggered (must be greater than 0)
java.lang.IllegalArgumentException - if any of the given arguments is nullTriggerClientpublic void terminate()
public void run()
Must not be called directly!
run in interface java.lang.Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||