반응형
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- RabbitMQ
- vue.js
- spring cloud
- JPA
- argo cd
- cassandra
- docker
- docker compose mysql
- Docker Compose
- docker-compose
- Redis Sentinel
- KAFKA
- ChannelPipeline
- weblogic 10
- Selenium
- Netty
- mybatis
- redis
- Hibernate
- coalesce
- jmeter
- grafana
- spring boot
- QueryDSL
- Airflow
- MySQL
- spring boot redis
- Spring Open Feign
- netflix oss
- WebLogic
Archives
- Today
- Total
IT.FARMER
Spring Timer Sample 본문
반응형
/*
* $Id: LawScheduleTimer.java ,v 1.1 2010. 12. 10. 오후 3:38:08 com.hynix.ecms Exp $
* created by : An Sang Kil
* creation-date : 2010. 12. 10.
* =========================================================
* Copyright (c) 2010 ManInSoft, Inc. All rights reserved.
*/
package com.dongbu.skan.schedule;
/**
* Law Batch job
* @author ahn
*
*/
public class LawScheduleTimer{
//1.2 SpingFreamWork JDK Timer 연동테스트
public void schedule(){
System.out.println("\\n\\n\\n 1.2 SpingFreamWork JDK Timer 연동테스트");
}
}
<!-- ************************************************************************************* -->
<!-- ****************************JDK Timer 지원 사용하기********************************** -->
<!-- ************************************************************************************* -->
<beans>
<!-- Spring JDK Timer case -->
<bean id="lawScheduleTimer" class="com..dongbu.skan.schedule.LawScheduleTimer"></bean>
<bean id="generatorJobProxy" class="org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean">
<property name="targetObject">
<ref local="lawScheduleTimer"/>
</property>
<property name="targetMethod">
<value>schedule</value>
</property>
</bean>
<bean id="scheduledTask" class="org.springframework.scheduling.timer.ScheduledTimerTask">
<!--wait 10 seconds before starting repeated execution -->
<property name="delay" value="10000" />
<!-- run every 50 seconds -->
<!--task 를 단지 한번만 실행하고자 한다면, period 속성을 0(혹은 음수값)으로 바꿔주면 된다.-->
<property name="period" value="50000" />
<property name="timerTask" ref="generatorJobProxy" />
</bean>
<bean id="scheduler" class="org.springframework.scheduling.timer.TimerFactoryBean">
<property name="scheduledTimerTasks">
<list>
<ref local="scheduledTask"/>
</list>
</property>
</bean>
-->
</beans>
JDK 1.3 Timer를 스프링에서 쉽게 사용할 수 있도록
Spring 에서 제공하는 Timer 사용하니 좋구나~
설명은 나중에.... 혹은 아래서 ~
reference : spring open frame work
반응형
'Spring' 카테고리의 다른 글
Spring Quartz 1-2 (0) | 2010.12.14 |
---|---|
Spring Quartz 1-1 (0) | 2010.12.14 |
Ibitis ResultMap XML 자동 생성하기. (0) | 2010.09.14 |
Mail - Spring JavaMailSender(2/2) - Mail sender Test (0) | 2010.09.14 |
Junit Spring ApplicationContext (Applacation Bean Test, Spring Bean Call) (0) | 2010.09.08 |