physis.core.triggers
Class TriggerImpl
java.lang.Object
|
+--physis.core.triggers.TriggerImpl
- All Implemented Interfaces:
- Trigger
- Direct Known Subclasses:
- DataExtractTrigger, EnvironmentTrigger, ParameterTrigger
- public class TriggerImpl
- extends java.lang.Object
- implements Trigger
Provides the basic implementation for the trigger classes. (setting parameters, types)
|
Field Summary |
protected long |
end
|
protected boolean |
is_periodical
|
protected long |
next
The update number of the next time when it should run. |
protected long |
start
|
protected long |
step
|
|
Method Summary |
protected void |
adjustPeriodicalSchedule()
This method shoulb be invoked after execution if the trigger is periodical. |
void |
execute()
This method should be overridden by the concrete implementations. |
void |
initialize(java.util.StringTokenizer params)
Sets the type and the scheduling information according to the type. |
void |
setParameters(java.util.StringTokenizer st)
Should be overridden in implementations. |
boolean |
shouldBeExecuted(long up_date)
If the current update number equals the next time then it should execute. |
boolean |
shouldBeRemoved()
If it's not periodical or it passed its end value then it should be removed. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
is_periodical
protected boolean is_periodical
start
protected long start
end
protected long end
step
protected long step
next
protected long next
- The update number of the next time when it should run.
TriggerImpl
public TriggerImpl()
shouldBeRemoved
public boolean shouldBeRemoved()
- If it's not periodical or it passed its end value then it should be removed.
- Specified by:
shouldBeRemoved in interface Trigger
shouldBeExecuted
public boolean shouldBeExecuted(long up_date)
- If the current update number equals the next time then it should execute.
- Specified by:
shouldBeExecuted in interface Trigger
- Following copied from interface:
physis.core.triggers.Trigger
- Parameters:
update_count - The number of already performed updates. A trigger may ignore this information if
its execution doesn't depend on time but some other conditions.
execute
public void execute()
- This method should be overridden by the concrete implementations.
- Specified by:
execute in interface Trigger
adjustPeriodicalSchedule
protected void adjustPeriodicalSchedule()
- This method shoulb be invoked after execution if the trigger is periodical.
initialize
public void initialize(java.util.StringTokenizer params)
- Sets the type and the scheduling information according to the type.
- Specified by:
initialize in interface Trigger
setParameters
public void setParameters(java.util.StringTokenizer st)
- Should be overridden in implementations.
- Specified by:
setParameters in interface Trigger