Package jadex.platform.service.cron
Class CronAgent
- java.lang.Object
- 
- jadex.platform.service.cron.CronAgent
 
- 
- All Implemented Interfaces:
- ICronService
 
 public class CronAgent extends java.lang.Object implements ICronService The cron agent is an agent based implementation of unix cron. Allows for specifying time pattern and a job. The time pattern will be checked every minute and the job will be executed if the pattern matches. The pattern corresponds to the way unix cron patterns are defined: * * * * * Min Hour Day of Month Month Mo-Fr 0-59 0-23 1-31 1-12 0-6 Specification allows for: - wildcard: * (any value) - value: 1 - values: 2,3,4 - range: 1-5 - steps: *\/5 (every 5) - combined patterns: p1|p2|p3
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected java.util.Map<java.lang.String,Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>>>jobsThe cron jobs (id -> job).protected longlookaheadThe agent lookahead.protected booleanrealtimeArgument if realtime should be used.protected booleanuseworkeragentThe agent lookahead.
 - 
Constructor SummaryConstructors Constructor Description CronAgent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ISubscriptionIntermediateFuture<T>addJob(CronJob<T> job)Add a schedule job.voidbody()The agent body.IFuture<java.lang.Boolean>containsJob(java.lang.String jobid)Test if a job is scheduled with an id.protected IFuture<java.lang.Void>doExecuteCommand(Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>> jobtup, long time)Execute the command of a job.protected IFuture<java.lang.Void>executeJob(Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>> jobtup, long time)Execute a job on worker agent or directly.IFuture<java.lang.Void>removeJob(java.lang.String jobid)Remove a schedule job.
 
- 
- 
- 
Field Detail- 
realtimeprotected boolean realtime Argument if realtime should be used.
 - 
lookaheadprotected long lookahead The agent lookahead.
 - 
useworkeragentprotected boolean useworkeragent The agent lookahead.
 - 
jobsprotected java.util.Map<java.lang.String,Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>>> jobs The cron jobs (id -> job).
 - 
agentprotected IInternalAccess agent The agent.
 
- 
 - 
Method Detail- 
bodypublic void body() The agent body.
 - 
addJobpublic <T> ISubscriptionIntermediateFuture<T> addJob(CronJob<T> job) Add a schedule job.- Specified by:
- addJobin interface- ICronService
- Parameters:
- job- The cron job.
 
 - 
removeJobpublic IFuture<java.lang.Void> removeJob(java.lang.String jobid) Remove a schedule job.- Specified by:
- removeJobin interface- ICronService
- Parameters:
- jobid- The job id.
 
 - 
containsJobpublic IFuture<java.lang.Boolean> containsJob(java.lang.String jobid) Test if a job is scheduled with an id.- Specified by:
- containsJobin interface- ICronService
- Parameters:
- jobid- The jobid.
 
 - 
executeJobprotected IFuture<java.lang.Void> executeJob(Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>> jobtup, long time) Execute a job on worker agent or directly.
 - 
doExecuteCommandprotected IFuture<java.lang.Void> doExecuteCommand(Tuple2<CronJob<?>,SubscriptionIntermediateFuture<?>> jobtup, long time) Execute the command of a job.
 
- 
 
-