Project

General

Profile

« Previous | Next » 

Revision 45260

migrated to dnet45

View differences:

modules/dnet-modular-index-service/trunk/src/main/java/eu/dnetlib/functionality/index/actors/ResultsetKeepAliveJob.java
39 39
		final String rsId = serviceResolver.getResourceIdentifier(epr);
40 40

  
41 41
		try {
42
			log.debug("\n\n keepalive resultset: " + rsId + " triggerId: " + context.getTrigger().getName() + "\n\n");
42
			log.debug("\n\n keepalive resultset: " + rsId + " triggerId: " + context.getTrigger().getJobKey().getName() + "\n\n");
43 43

  
44 44
			// TODO: change to a getRSStatus call, getNumberOfElements could be potentially slow (ticket #1569)
45 45
			resultSet.getNumberOfElements(rsId);
modules/dnet-modular-index-service/trunk/src/main/java/eu/dnetlib/functionality/index/action/FeedIndexAction.java
10 10
import eu.dnetlib.functionality.index.feed.FeedMode;
11 11
import org.apache.commons.logging.Log;
12 12
import org.apache.commons.logging.LogFactory;
13
import org.quartz.JobDetail;
14
import org.quartz.Scheduler;
15
import org.quartz.SchedulerException;
16
import org.quartz.SimpleTrigger;
13
import org.quartz.*;
14
import org.quartz.impl.triggers.SimpleTriggerImpl;
17 15
import org.springframework.beans.factory.annotation.Autowired;
18 16
import org.springframework.beans.factory.annotation.Required;
17
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
19 18

  
20 19
import java.util.UUID;
21 20

  
......
74 73
        handler.ongoing(job);
75 74
        log.info("FEED job set to ONGOING");
76 75

  
77
        final JobDetail tmp = getJobScheduler().getJobDetail(ResultsetKeepAliveJob.JOB_NAME, ResultsetKeepAliveJob.JOB_GROUP);
76
        final JobKey jobKey = new JobKey(ResultsetKeepAliveJob.JOB_NAME);
77
        final JobDetail tmp = getJobScheduler().getJobDetail(jobKey);
78 78
        final String epr = getEpr(job);
79 79
        final String triggerId = UUID.randomUUID().toString();
80 80
        final String dsId = getIndexDSId(job);
......
114 114
     * @return a new org.quartz.SimpleTrigger instance.
115 115
     */
116 116
    private SimpleTrigger getResultsetTrigger(final String rsEpr, final String triggerId) {
117
        final SimpleTrigger trigger = new SimpleTrigger(triggerId, ResultsetKeepAliveJob.JOB_GROUP, SimpleTrigger.REPEAT_INDEFINITELY, getRepeatDelay());
117

  
118
        final SimpleTriggerImpl trigger = new SimpleTriggerImpl(triggerId, ResultsetKeepAliveJob.JOB_GROUP, SimpleTrigger.REPEAT_INDEFINITELY, getRepeatDelay());
118 119
        trigger.getJobDataMap().put(BBParam.RS_EPR, rsEpr);
119 120
        trigger.setJobName(ResultsetKeepAliveJob.JOB_NAME);
120 121
        trigger.setJobGroup(ResultsetKeepAliveJob.JOB_GROUP);
......
158 159
            public void unschedule() {
159 160
                try {
160 161
                    log.info("\n\n unscheduling resultSet keepalive trigger: " + triggerId + "\n\n");
161
                    jobScheduler.unscheduleJob(triggerId, ResultsetKeepAliveJob.JOB_GROUP);
162
                    final TriggerKey triggerKey = new TriggerKey(triggerId);
163
                    jobScheduler.unscheduleJob(triggerKey);
162 164
                } catch (SchedulerException e) {
163 165
                    log.warn("cannot unschedule RSKeepAlive triggerId: " + triggerId);
164 166
                    throw new RuntimeException(e); // NOPMD
modules/dnet-modular-index-service/trunk/src/main/resources/eu/dnetlib/functionality/actor/applicationContext-actors.xml
36 36
		</property>
37 37
	</bean>
38 38

  
39
	<bean id="resultsetKeepaliveJob" class="org.springframework.scheduling.quartz.JobDetailBean"
39
	<bean id="resultsetKeepaliveJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"
40 40
		p:jobClass="eu.dnetlib.functionality.index.actors.ResultsetKeepAliveJob"
41 41
		p:name="resultsetKeepaliveJob" p:group="keepalive" p:durability="true">
42 42
		<property name="jobDataAsMap">
modules/dnet-modular-index-service/trunk/pom.xml
2 2
	<modelVersion>4.0.0</modelVersion>
3 3
	<parent>
4 4
		<groupId>eu.dnetlib</groupId>
5
		<artifactId>dnet-parent</artifactId>
6
		<version>1.0.0</version>
5
		<artifactId>dnet45-parent</artifactId>
6
		<version>1.0.0-SNAPSHOT</version>
7 7
	</parent>
8 8
	<groupId>eu.dnetlib</groupId>
9 9
	<artifactId>dnet-modular-index-service</artifactId>
10 10
	<version>2.5.1-SNAPSHOT</version>
11 11
	<scm>
12
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-modular-index-service/trunk</developerConnection>
12
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-modular-index-service/trunk</developerConnection>
13 13
	</scm>
14 14
	<repositories>
15 15
		<!-- repo for Akka Actors -->

Also available in: Unified diff