<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <import resource="applicationContext_sqlIMSKING.xml" /> <!-- 属性文件读入 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db_IMSKING.properties</value>
</list>
</property>
</bean> <!-- 数据源定义,使用c3p0 连接池 -->
<bean id="quartzdataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="${imsking.jdbc.driverClassName}" />
<property name="jdbcUrl" value="${imsking.jdbc.url}" />
<property name="user" value="${imsking.jdbc.username}" />
<property name="password" value="${imsking.jdbc.password}" />
<property name="initialPoolSize" value="${cpool.minPoolSize}" />
<property name="minPoolSize" value="${cpool.minPoolSize}" />
<property name="maxPoolSize" value="${cpool.maxPoolSize}" />
<property name="acquireIncrement" value="${cpool.acquireIncrement}" />
<property name="maxIdleTime" value="${cpool.maxIdleTime}" />
</bean>
<bean name="quartzScheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource" ref="quartzdataSource" />
<property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
<property name="configLocation" value="classpath:quartz.properties" />
</bean>
<bean name="simpleService" class="optima.frame.plan.model.SimpleService"> </bean>
<bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>
optima.frame.plan.model.MyQuartzJobBean
</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="simpleService">
<ref bean="simpleService" />
</entry>
</map>
</property>
</bean> <!-- 排程管理 -->
<bean name="quartzDao" class="optima.frame.plan.dao.impl.QuartzDaoImpl">
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean name="schedulerModel" class="optima.frame.plan.model.SchedulerModelImpl">
<property name="jobDetail">
<ref bean="jobDetail" />
</property>
<property name="scheduler">
<ref bean="quartzScheduler" />
</property>
<property name="quartzDao">
<ref bean="quartzDao" />
</property>
</bean>
<bean name="quartzquery" class="optima.frame.plan.action.QuartzsAction">
<property name="schedulerModel">
<ref bean="schedulerModel" />
</property>
</bean>
</beans>
上面是我的动态加载任务的配置,如何把动态加载的任务按照有状态的执行,(有状态的任务不能并发执行,无状态的任务可并发执行)就是把这句<property name="concurrent" value="false" /> ③ 指定最终封装出的任务是否有状态,加在那里quartzconcurrent并发动态加载有状态的
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <import resource="applicationContext_sqlIMSKING.xml" /> <!-- 属性文件读入 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db_IMSKING.properties</value>
</list>
</property>
</bean> <!-- 数据源定义,使用c3p0 连接池 -->
<bean id="quartzdataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="${imsking.jdbc.driverClassName}" />
<property name="jdbcUrl" value="${imsking.jdbc.url}" />
<property name="user" value="${imsking.jdbc.username}" />
<property name="password" value="${imsking.jdbc.password}" />
<property name="initialPoolSize" value="${cpool.minPoolSize}" />
<property name="minPoolSize" value="${cpool.minPoolSize}" />
<property name="maxPoolSize" value="${cpool.maxPoolSize}" />
<property name="acquireIncrement" value="${cpool.acquireIncrement}" />
<property name="maxIdleTime" value="${cpool.maxIdleTime}" />
</bean>
<bean name="quartzScheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource" ref="quartzdataSource" />
<property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
<property name="configLocation" value="classpath:quartz.properties" />
</bean>
<bean name="simpleService" class="optima.frame.plan.model.SimpleService"> </bean>
<bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>
optima.frame.plan.model.MyQuartzJobBean
</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="simpleService">
<ref bean="simpleService" />
</entry>
</map>
</property>
</bean> <!-- 排程管理 -->
<bean name="quartzDao" class="optima.frame.plan.dao.impl.QuartzDaoImpl">
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean name="schedulerModel" class="optima.frame.plan.model.SchedulerModelImpl">
<property name="jobDetail">
<ref bean="jobDetail" />
</property>
<property name="scheduler">
<ref bean="quartzScheduler" />
</property>
<property name="quartzDao">
<ref bean="quartzDao" />
</property>
</bean>
<bean name="quartzquery" class="optima.frame.plan.action.QuartzsAction">
<property name="schedulerModel">
<ref bean="schedulerModel" />
</property>
</bean>
</beans>
上面是我的动态加载任务的配置,如何把动态加载的任务按照有状态的执行,(有状态的任务不能并发执行,无状态的任务可并发执行)就是把这句<property name="concurrent" value="false" /> ③ 指定最终封装出的任务是否有状态,加在那里quartzconcurrent并发动态加载有状态的
解决方案 »
- Controller 单元测试报异常:Invocation of init method failed
- 求助 jquery
- 急!(SSH)struts2 action无法跳转到jsp
- java.util.concurrent.ExecutorService使用问题
- 如何实现login成功后关闭login刷新主窗口
- 关于jsp代码到一半就不继续了的问题.谁遇到过??
- 文章分段显示问题,高分请教。
- jdk+Tomcat+Mysql无法配通?
- 关于用jsp调用本地方法的问题,请各位高手进来帮忙
- JikLiu(小铃铛), nxxld (ForJava) 混的不错嘛,都四个三角了,讲解还贼详细,要不要进来解释一下
- 垃圾回收,如何配置指定年轻代用Serival收集器,年老代用CMS?
- 1. Request的应用。在工程中新建一个jsp页面,在页面中实现加减乘除的运算页面,并实现运算结果的计算显示功能
Error creating bean with name 'jobDetail' defined in ServletContext resource [/WEB-INF/classes/applicationContext_quartz.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'concurrent' of bean class [org.springframework.scheduling.quartz.JobDetailBean]: Bean property 'concurrent' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?