Project

General

Profile

« Previous | Next » 

Revision 45122

migrated to dnet45, using updated quartzo version

View differences:

modules/cnr-notifications-common/trunk/cnr-notifications-common.iml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
4
    <output url="file://$MODULE_DIR$/target/classes" />
5
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
    <content url="file://$MODULE_DIR$">
7
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
11
      <excludeFolder url="file://$MODULE_DIR$/target" />
12
    </content>
13
    <orderEntry type="inheritedJdk" />
14
    <orderEntry type="sourceFolder" forTests="false" />
15
    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-common:2.1.6-SNAPSHOT" level="project" />
16
    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
17
    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
18
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
19
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" />
20
    <orderEntry type="module" module-name="cnr-misc-utils" />
21
    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
22
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
23
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
24
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
25
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
26
    <orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" />
27
    <orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" />
28
    <orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" />
29
    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" />
30
    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
31
    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" />
32
    <orderEntry type="module" module-name="cnr-service-utils" />
33
    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
34
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" />
35
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
36
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
37
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" />
38
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" />
39
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" />
40
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" />
41
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
42
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
43
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" />
44
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" />
45
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" />
46
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" />
47
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
48
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-api:2.7.8" level="project" />
49
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.2.0" level="project" />
50
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.1" level="project" />
51
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.0.3" level="project" />
52
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1" level="project" />
53
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
54
    <orderEntry type="module" module-name="cnr-spring-utils" />
55
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
56
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" />
57
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
58
    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" />
59
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" />
60
    <orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" />
61
    <orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" />
62
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" />
63
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" />
64
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" />
65
    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" />
66
    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
67
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
68
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
69
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
70
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
71
  </component>
72
</module>
modules/cnr-notifications-common/trunk/src/main/java/eu/dnetlib/enabling/tools/AbstractSchedulable.java
5 5
import javax.annotation.PostConstruct;
6 6
import javax.annotation.Resource;
7 7

  
8
import org.quartz.CronExpression;
9
import org.quartz.CronTrigger;
10
import org.quartz.Job;
11
import org.quartz.JobDataMap;
12
import org.quartz.JobDetail;
13
import org.quartz.JobExecutionContext;
14
import org.quartz.JobExecutionException;
15
import org.quartz.Scheduler;
16
import org.quartz.SchedulerException;
17
import org.quartz.Trigger;
8
import org.quartz.*;
9
import org.quartz.Trigger.TriggerState;
10
import org.quartz.impl.JobDetailImpl;
11
import org.quartz.impl.triggers.CronTriggerImpl;
18 12
import org.springframework.beans.factory.BeanNameAware;
19 13
import org.springframework.beans.factory.annotation.Required;
20 14

  
......
46 40
			JobDataMap jobDataMap = new JobDataMap();
47 41
			jobDataMap.put(THIS, this);
48 42

  
49
			JobDetail jd = new JobDetail();
43
			JobDetailImpl jd = new JobDetailImpl();
50 44
			jd.setName(getBeanName());
51 45
			jd.setGroup(GROUP);
52 46
			jd.setJobDataMap(jobDataMap);
......
61 55

  
62 56
	private Trigger createTrigger() {
63 57
		try {
64
			CronTrigger trigger = new CronTrigger(getBeanName(), GROUP, getCronExpression());
65
			trigger.setMisfireInstruction(Trigger.INSTRUCTION_NOOP);
58
			CronTriggerImpl trigger = new CronTriggerImpl(getBeanName(), GROUP, getCronExpression());
59
			trigger.setMisfireInstruction(Trigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY);
66 60
			trigger.setJobGroup(GROUP);
67 61
			trigger.setJobName(getBeanName());
68 62
			return trigger;
......
121 115
		if (!cronExpression.equals(getCronExpression())) {
122 116
			setCronExpression(cronExpression);
123 117
			try {
124
				jobScheduler.rescheduleJob(getBeanName(), GROUP, createTrigger());
118
				final TriggerKey tk = new TriggerKey(getBeanName());
119
				jobScheduler.rescheduleJob(tk, createTrigger());
125 120
			} catch (SchedulerException e) {
126 121
				throw new RuntimeException("unable to reschedule trigger", e);
127 122
			}
......
137 132
			if (!isEnabled()) {
138 133
				return "";
139 134
			}
140
			Trigger t = jobScheduler.getTrigger(getBeanName(), GROUP);
135
			final TriggerKey tk = new TriggerKey(getBeanName());
136
			final Trigger t = jobScheduler.getTrigger(tk);
141 137
			return t != null ? t.getNextFireTime().toString() : "";
142 138
		} catch (SchedulerException e) {
143 139
			throw new RuntimeException("unable to get trigger", e);
......
147 143
	@Override
148 144
	public boolean isPaused() {
149 145
		try {
150
			int state = jobScheduler.getTriggerState(getBeanName(), GROUP);
146
			final TriggerKey tk = new TriggerKey(getBeanName());
147
			final TriggerState state = jobScheduler.getTriggerState(tk);
151 148
			switch (state) {
152
			case Trigger.STATE_PAUSED:
153
			case Trigger.STATE_NONE:
154
			case Trigger.STATE_ERROR:
149
			case PAUSED:
150
			case NONE:
151
			case ERROR:
155 152
				return true;
156 153
			default:
157 154
				return false;
......
164 161
	@Override
165 162
	public void pause() {
166 163
		try {
167
			jobScheduler.pauseTrigger(getBeanName(), GROUP);
164
			final TriggerKey tk = new TriggerKey(getBeanName());
165
			jobScheduler.pauseTrigger(tk);
168 166
		} catch (SchedulerException e) {
169 167
			throw new RuntimeException("unable to pause trigger", e);
170 168
		}
......
173 171
	@Override
174 172
	public void resume() {
175 173
		try {
176
			jobScheduler.resumeTrigger(getBeanName(), GROUP);
174
			final TriggerKey tk = new TriggerKey(getBeanName());
175
			jobScheduler.resumeTrigger(tk);
177 176
		} catch (SchedulerException e) {
178 177
			throw new RuntimeException("unable to resume trigger", e);
179 178
		}
modules/cnr-notifications-common/trunk/pom.xml
2 2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
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
		<relativePath />
8 8
	</parent>
9 9
	<modelVersion>4.0.0</modelVersion>
......
12 12
	<packaging>jar</packaging>
13 13
	<version>2.1.1-SNAPSHOT</version>
14 14
	<scm>
15
	  <developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/cnr-notifications-common/trunk</developerConnection>
15
	  <developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/cnr-notifications-common/trunk</developerConnection>
16 16
	</scm>
17 17
	<dependencies>
18 18
		<dependency>
......
26 26
			<version>${spring.version}</version>
27 27
		</dependency>
28 28
		<dependency>
29
			<groupId>opensymphony</groupId>
29
			<groupId>org.quartz-scheduler</groupId>
30 30
			<artifactId>quartz</artifactId>
31
			<version>1.6.6</version>
31
			<version>${quartz.version}</version>
32 32
		</dependency>
33 33
	</dependencies>
34 34
</project>

Also available in: Unified diff