The Reverse Search Engine
[ start | index | login ]
home > scheduling

scheduling

Created by mfranken. Last edited by mfranken, 3 years and 269 days ago. Viewed 7,765 times. #10
[diff] [history] [edit] [rdf]
labels
attachments
Since version 1.0

Indexes can be created automatically by specifying a schedule in schedule-context.xml. The following snippet will start the (incremental) scheduling process every night at 03:14, which is set by default.

<bean id="methodInvokingJobDetail" 
	  class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
	    <property name="targetObject"><ref bean="indexService"/></property>
	    <property name="targetMethod"><value>index</value></property>
	</bean>

<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="methodInvokingJobDetail"/> </property> <property name="cronExpression"> <!-- run every night at 03:14 --> <value>0 14 03 * * ?</value> </property> </bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <!-- comment the following line to disable scheduling --> <ref local="cronTrigger"/> </list> </property> </bean>

Scheduling is done via Quartz, the schedule can be specified using a 'cron' expression. For more information see >>http://www.quartzscheduler.org/quartz/tutorial.html#cronTriggers

NB: you can specify multiple schedules yourself. If you want to create a new index instead of incrementally, use reindex instead of index in the methodInvokingJobDetail bean.

For instance:

<bean id="reIndexingJobDetail" 
	  class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
	    <property name="targetObject"><ref bean="indexService"/></property>
	    <property name="targetMethod"><value>reindex</value></property>
	</bean>

<bean id="indexingJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"><ref bean="indexService"/></property> <property name="targetMethod"><value>index</value></property> </bean>

<bean id="indexTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="indexingJobDetail"/> </property> <property name="cronExpression"> <!-- run every night before working day at 03:15 --> <value>0 15 03 * * SUN-FRI</value> </property> </bean>

<bean id="reIndexTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="reindexingJobDetail"/> </property> <property name="cronExpression"> <!-- run every saturday at 03:15 --> <value>0 15 03 * * SAT</value> </property> </bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <!-- uncomment this to make the schedule work <ref local="indexTrigger"/> <ref local="reIndexTrigger"/> --> </list> </property> </bean>

no comments | post comment

Zilverline
Visit Zilverline for Agile Coaching and Training

News

I've just released version 1.5.0
This version adds security and allows you to
upload documents to collections.

Get Zilverline

Zilverline is free of charge for personal and
R&D use. For commercial use you will have to
pay or contribute.

See Getting Zilverline.

Source

The source code can be found at Source Code

Build Information

All build reports generated with Maven
are accessible >>here

Installation

If you're upgrading from a previous version,
I advice you to follow the installation,
and copy your existing configuration
(collectionManager.xml and
searchService.xml) in your
Home Directory (user.home).
See also Quick start.

Screenshot

Here is one: screenshot

FAQ

Read the FAQ before getting started.

Best viewed with Get Firefox!

Made with Spring Framework

Built with MaviClipse

Powered by lucene

AgileHolland AgileHolland member.



< February 2010 >
SunMonTueWedThuFriSat
123456
78910111213
14151617181920
21222324252627
28
Powered by SnipSnap 1.0b1-mfranken
snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt