|
S2Quartz offers the following features:
- Using Quartz, execute periodically components in S2Container
- Quartz Scheduler life-cycle management and job scheduling may be done by edit *.dicon file.
- Quartz job component may use Seasar DI and AOP.
S2Quartz may be downloaded from here.
To install just the class files, extract s2-quartz-0.0.2.zip to some directory and set CLASSPATH to contain this file.
To install from the source file, Maven is required. After setting up Maven, execute the following steps:
> tar xzf s2-quartz-0.0.2-src.tar.gz
> cd s2-quartz-0.0.2
> maven jar:install
Following is an example to execute increment() method in counterService component every 10 second.
Example dicon file
<components>
<component class="org.quartz.impl.StdSchedulerFactory" />
<component class="org.seasar.quartz.SchedulerImpl">
<initMethod name="start" />
<initMethod name="scheduleJob">
<arg>
<component class="org.seasar.quartz.MethodInvokerJobDetail">
<property name="name">"incrementCounterJob"</property>
<property name="component">counterService</property>
<property name="method">"increment"</property>
</component>
</arg>
<arg>
<component class="org.seasar.quartz.CronTrigger">
<property name="name">"incrementCounterTrigger"</property>
<property name="cronExpression">"0/10 * * ? * *"</property>
</component>
</arg>
</initMethod>
<destroyMethod name="shutdown" />
</component>
<component class="org.seasar.quartz.example.CounterServiceImpl" name="counterService" />
</components>
|