Skip to content

Commit

Permalink
sostituito scheduler quartz con scheduler spring
Browse files Browse the repository at this point in the history
  • Loading branch information
francescou committed Sep 27, 2016
1 parent 223ae18 commit 60ee5b9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 63 deletions.
5 changes: 0 additions & 5 deletions SIGLA/pom.xml
Expand Up @@ -366,11 +366,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.googlecode.jcsv</groupId>
<artifactId>jcsv</artifactId>
Expand Down
@@ -1,10 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">

http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/task https://www.springframework.org/schema/task/spring-task-4.3.xsd">


<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
Expand All @@ -14,10 +16,10 @@
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
</bean>
<import resource="classpath*:it/cnr/contab/cmis/service/cmis-service-context.xml"/>
<import resource="classpath*:it/cnr/contab/service/sdi-client-service-context.xml"/>

<jee:jndi-lookup id="offlineReportComponent"
jndi-name="java:global/SIGLA/sigla-ejb/BREPORTS_EJB_OfflineReportComponentSession"
resource-ref="false">
Expand All @@ -28,19 +30,19 @@
</jee:jndi-lookup>
<jee:jndi-lookup id="ricezioneFattureService"
jndi-name="java:global/SIGLA/sigla-sdi/RicezioneFatture!it.cnr.contab.docamm00.ejb.RicezioneFatturePA"
resource-ref="false"/>
resource-ref="false"/>
<jee:jndi-lookup id="trasmissioneFattureService"
jndi-name="java:global/SIGLA/sigla-sdi/TrasmissioneFatture!it.cnr.contab.docamm00.ejb.TrasmissioneFatturePA"
resource-ref="false"/>
resource-ref="false"/>
<jee:jndi-lookup id="fatturaElettronicaPassivaComponentSession"
jndi-name="java:global/SIGLA/sigla-ejb/CNRDOCAMM00_EJB_FatturaElettronicaPassivaComponentSession"
resource-ref="false"/>
resource-ref="false"/>
<jee:jndi-lookup id="ricercaDocContComponentSession"
jndi-name="java:global/SIGLA/sigla-ejb/CNRCHIUSURA00_EJB_RicercaDocContComponentSession"
resource-ref="false"/>
resource-ref="false"/>
<jee:jndi-lookup id="docAmmFatturazioneElettronicaComponentSession"
jndi-name="java:global/SIGLA/sigla-ejb/CNRDOCAMM00_EJB_DocAmmFatturazioneElettronicaComponentSession"
resource-ref="false"/>
resource-ref="false"/>
<bean id="trovatoProperties" class="it.cnr.contab.docamm00.client.TrovatoProperties">
<property name="trovatoTargetEndpoint" value="${TrovatoTargetEndpoint}" />
<property name="trovatoSiglaRestClientUser" value="${TrovatoSiglaRestClientUser}" />
Expand All @@ -56,8 +58,8 @@
<bean id="ldapService" class="it.cnr.contab.utenze00.service.LDAPService">
<property name="gestioneLoginComponent" ref="gestioneLoginComponent"/>
</bean>


<bean id="fatturaPassivaElettronicaService" class="it.cnr.contab.docamm00.service.FatturaPassivaElettronicaService">
<property name="fatturaElettronicaPassivaComponentSession" ref="fatturaElettronicaPassivaComponentSession"/>
<property name="docAmmFatturazioneElettronicaComponentSession" ref="docAmmFatturazioneElettronicaComponentSession"/>
Expand All @@ -76,7 +78,7 @@
<property name="pecSDISubjectRiceviFattureTerm" value="${pec.sdi.subject.ricevi.fatture.term}"/>
<property name="pecScanFolderName" value="${pec.scan.folder.name}"/>
<property name="pecScanReceiptFolderName" value="${pec.scan.receipt.folder.name}"/>

<property name="pecSDISubjectFatturaAttivaRicevutaConsegnaTerm" value="${pec.sdi.subject.fatturaAttiva.notifica.ricevutaConsegna.term}"/>
<property name="pecSDISubjectFatturaAttivaNotificaScartoTerm" value="${pec.sdi.subject.fatturaAttiva.notifica.scarto.term}"/>
<property name="pecSDISubjectFatturaAttivaMancataConsegnaTerm" value="${pec.sdi.subject.fatturaAttiva.notifica.mancataConsegna.term}"/>
Expand All @@ -98,49 +100,9 @@
<prop key="mail.imap.connectiontimeout">${pec.mail.imap.connectiontimeout}</prop>
<prop key="mail.imap.timeout">${pec.mail.imap.timeout}</prop>
</props>
</property>
</bean>
<!-- quartz stuff below -->

<!-- UpdaterOnScheduleJobDetail defines a bean that points to
UpdaterOnScheduleExecutor and says to call its execute()
method when the trigger is fired -->
<bean id="PECCronTriggerBeanDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="fatturaPassivaElettronicaService"/>
<property name="targetMethod" value="execute"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="AllineaNotificheCronTriggerBeanDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="fatturaPassivaElettronicaService"/>
<property name="targetMethod" value="allineaNotificheExecute"/>
<property name="concurrent" value="false"/>
</bean>

<!-- here's where we use the Cron like scheduling expression
to define when the bean is run. -->
<bean id="PECCronTriggerBean"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="PECCronTriggerBeanDetail" />
<property name="cronExpression" value="${pec.cron.expression}"/>
</bean>
<bean id="AllineaNotificheCronTriggerBean"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="AllineaNotificheCronTriggerBeanDetail" />
<property name="cronExpression" value="${allinea.notifiche.cron.expression}"/>
</bean>

<!-- the scheduler factory is what does the work to setup
the triggers -->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="PECCronTriggerBean" />
<ref bean="AllineaNotificheCronTriggerBean" />
</list>
</property>
</property>
</bean>

<bean name="props-aruba" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>
Expand All @@ -149,8 +111,24 @@
arubaRemoteSignService.url=${arubaRemoteSignService.url}
</value>
</property>
</bean>
</bean>
<bean id="arubaSignServiceClient" class="it.cnr.jada.firma.arss.ArubaSignServiceClient">
<property name="props" ref="props-aruba"></property>
</bean>
<property name="props" ref="props-aruba"></property>
</bean>


<!-- scheduler -->
<task:scheduled-tasks scheduler="siglaScheduler">
<task:scheduled ref="fatturaPassivaElettronicaService" method="allineaNotificheExecute" cron="${allinea.notifiche.cron.expression}" />
<task:scheduled ref="fatturaPassivaElettronicaService" method="execute" cron="${pec.cron.expression}" />
</task:scheduled-tasks>

<task:scheduler id="siglaScheduler" pool-size="10"/>

<task:executor id="siglaTaskExecutor" pool-size="5"/>
<task:annotation-driven executor="siglaTaskExecutor" scheduler="siglaScheduler"/>
<!-- / scheduler -->



</beans>

0 comments on commit 60ee5b9

Please sign in to comment.