Class PeriodicExecutorImpl
- java.lang.Object
-
- org.apache.tapestry5.ioc.internal.services.cron.PeriodicExecutorImpl
-
- All Implemented Interfaces:
java.lang.Runnable
,PeriodicExecutor
public class PeriodicExecutorImpl extends java.lang.Object implements PeriodicExecutor, java.lang.Runnable
-
-
Constructor Summary
Constructors Constructor Description PeriodicExecutorImpl(ParallelExecutor parallelExecutor, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PeriodicJob
addJob(Schedule schedule, java.lang.String name, java.lang.Runnable job)
Adds a job to be executed.void
init()
Initializes this service.void
run()
void
start(RegistryShutdownHub hub)
-
-
-
Constructor Detail
-
PeriodicExecutorImpl
public PeriodicExecutorImpl(ParallelExecutor parallelExecutor, org.slf4j.Logger logger)
-
-
Method Detail
-
start
@PostInjection public void start(RegistryShutdownHub hub)
-
init
public void init()
Description copied from interface:PeriodicExecutor
Initializes this service. Never call this method direclty. It's intended for internal Tapestry-IoC usage only.- Specified by:
init
in interfacePeriodicExecutor
-
addJob
public PeriodicJob addJob(Schedule schedule, java.lang.String name, java.lang.Runnable job)
Description copied from interface:PeriodicExecutor
Adds a job to be executed. The job is executed in a thread pool (viaParallelExecutor.invoke(org.apache.tapestry5.ioc.Invokable)
), as determined by the schedule.- Specified by:
addJob
in interfacePeriodicExecutor
- Parameters:
schedule
- defines when the job will next executename
- a name used in debugging output related to the jobjob
- a Runnable object that represents the work to be done- Returns:
- a PeriodicJob that can be used to query when the job executes, or to cancel its execution
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-