티스토리 뷰

Quartz Schedule 사용 시 parameter 전달 xml에 설정하는 방법 arguments 에 List 식으로 추가하면 된다. 아래 소스를 보면 확인 할 수 있다.

1
2
3
4
5
6
7
8
9
10
<bean id="scheduleId" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  <property name="targetObject" ref="scheduleService" />
  <property name="targetMethod" value="scheduleMethod" />
  <property name="concurrent" value="false" />
  <property name="arguments">
          <list>
              <value>true</value>
          </list>
  </property>
</bean>

1
2
public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethodInvoker
  implements FactoryBean<JobDetail>, BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean {

1
public class ArgumentConvertingMethodInvoker extends MethodInvoker {

1
2
3
4
5
6
7
8
9
public class MethodInvoker {
...
  /**
   * Set arguments for the method invocation. If this property is not set,
   * or the Object array is of length 0, a method with no arguments is assumed.
   */
  public void setArguments(Object[] arguments) {
    this.arguments = (arguments != null ? arguments : new Object[0]);
  }
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
more
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함