jhleem / egov star

이다솜 이다솜 2022-02-23 @141

[20220223 이다솜] Scheduled 수정 코밋
Index: base3.10/src/main/java/egovframework/com/sym/log/blg/service/BbsLogScheduling.java =================================================================== --- base3.10/src/main/java/egovframework/com/sym/log/blg/service/BbsLogScheduling.java (revision 140) +++ base3.10/src/main/java/egovframework/com/sym/log/blg/service/BbsLogScheduling.java (revision 141) @@ -2,9 +2,9 @@ import javax.annotation.Resource; -import org.springframework.stereotype.Service; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; -import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; import egovframework.rte.fdl.cmmn.exception.EgovBizException; /** @@ -12,8 +12,8 @@ * @author 이다솜 * */ -@Service("bbsLogScheduling") -public class BbsLogScheduling extends EgovAbstractServiceImpl { +@Component +public class BbsLogScheduling { @Resource(name="BbsLogService") private BbsLogService bbsLogService; @@ -22,6 +22,7 @@ * 게시글 로그 요약 등록 * @throws Exception */ + @Scheduled(cron = "0 0 17 * * *") public void insertBbsLogSummary() throws EgovBizException { bbsLogService.insertBbsLogSummary(); } Index: base3.10/src/main/resources/egovframework/spring/com/scheduling/context-scheduling-sym-log-blg.xml =================================================================== --- base3.10/src/main/resources/egovframework/spring/com/scheduling/context-scheduling-sym-log-blg.xml (revision 140) +++ base3.10/src/main/resources/egovframework/spring/com/scheduling/context-scheduling-sym-log-blg.xml (nonexistent) @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> - - <!-- 게시글 로그 요약 --> - <bean id="bbsLogging" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> - <property name="targetObject" ref="bbsLogScheduling" /> - <property name="targetMethod" value="insertBbsLogSummary" /> - <property name="concurrent" value="false" /> - </bean> - - <!-- 게시글 로그 요약 트리거--> - <bean id="bbsLogTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"> - <property name="jobDetail" ref="bbsLogging" /> - <!-- 시작하고 1분후에 실행한다. (milisecond) --> - <property name="startDelay" value="60000" /> -<!-- 매 60분마다 실행한다. (milisecond) 데몬 형식으로 계속 기동 중 --> - <property name="repeatInterval" value="3600000" /> - <!-- CRON과 같이 시각을 지정하는 경우 다음 참조 --> -<!-- <property name="cronExpression" value="0 0 17 * * *" /> --> -<!-- <property name="cronExpression" value="0 0/5 * * * ?" /> --> - </bean> - - <!-- 게시글 로그 요약 스케줄러 --> - <bean id="bbsLogScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> - <property name="triggers"> - <list> - <ref bean="bbsLogTrigger" /> - </list> - </property> - </bean> -</beans>
Add a comment
List