org.gcube.common.core.contexts.ghn
Class Scheduler
java.lang.Object
org.gcube.common.core.utils.handlers.GCUBEHandler<HANDLED>
org.gcube.common.core.utils.handlers.GCUBEScheduledHandler<GHNContext>
org.gcube.common.core.contexts.ghn.Scheduler
- All Implemented Interfaces:
- GCUBEIHandler<GHNContext>, Lifetime<GHNContext>
public class Scheduler
- extends GCUBEScheduledHandler<GHNContext>
Schedules updates to the gHN profile.
- Author:
- Fabio Simeoni (University of Strathclyde)
|
Method Summary |
protected boolean |
repeat(Exception exception,
int exceptionCount)
Indicates whether the scheduling should continue. |
| Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler |
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getScopeManager, getSecurityManager, getState, notify, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, setState, subscribe, undo, unsubscribe |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.gcube.common.core.utils.handlers.lifetime.Lifetime |
getState |
| Methods inherited from interface org.gcube.common.core.utils.handlers.GCUBEIHandler |
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getScopeManager, getSecurityManager, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, subscribe, undo, unsubscribe |
Scheduler
public Scheduler(GHNContext ctxt,
long interval,
GCUBEScheduledHandler.Mode mode)
- Creates an instance.
- Parameters:
ctxt - the GHNContext.interval - the schedule interval.mode - the scheduling mode.
repeat
protected boolean repeat(Exception exception,
int exceptionCount)
- Indicates whether the scheduling should continue.
It is invoked after each iteration of the schedule as a pre-condition to continue it.
By default, it returns
true if no exception occurred during the iteration,
and false otherwise. Override to implement
specific conditions.
- Overrides:
repeat in class GCUBEScheduledHandler<GHNContext>
- Parameters:
exception - any exception which may have occurred during the iteration,
or null if the iteration completed successfully.exceptionCount - the number of exceptions which have occurred so far during the schedule.
- Returns:
true if the scheduling should continue, false otherwise.
Copyright © 2013. All Rights Reserved.