com.poscoict.glueframework.scheduling.store
Class GlueScheduledJobInfoLogger

java.lang.Object
  extended by com.poscoict.glueframework.scheduling.store.GlueScheduledJobInfoLogger
All Implemented Interfaces:
org.quartz.JobListener, InitializingBean

public class GlueScheduledJobInfoLogger
extends Object
implements org.quartz.JobListener, InitializingBean

JobListener 구현체. 스케줄링된 Job의 수행결과 정보를 DB에 저장한다.

 Bean Property
 
 - dataSource : (필수) oracle 연결정보.
 
 
 
 예제
 사용 예# 1
 
     <bean id="dblogging" class="com.poscoict.glueframework.scheduling.store.GlueScheduledJobInfoLogger">
         <property name="dataSource" ref="ds"/>
     </bean>
     <bean id="ds" class="..."/>
     <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="true">
         <property name="triggers" ...>
         ...
         <property name="globalJobListeners">
             <list>
                 <ref local="dblogging"/>
             </list>
         </property>
     </bean>
 


Nested Class Summary
static class GlueScheduledJobInfoLogger.JobLoggingQuery
          DBMS 에 따른 SQL문
 
Field Summary
protected static String ROW_KEY
           
 
Constructor Summary
GlueScheduledJobInfoLogger()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getName()
           
 void jobExecutionVetoed(org.quartz.JobExecutionContext context)
          job 수행이 거부될 때 호출된다.
 void jobToBeExecuted(org.quartz.JobExecutionContext context)
          Job이 실행되기 직전에 호출되는 메소드.
 void jobWasExecuted(org.quartz.JobExecutionContext context, org.quartz.JobExecutionException jobException)
          Job 실행이 완료되면 호출되는 메소드.
 void setDataSource(DataSource dataSource)
          setter method for DI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROW_KEY

protected static final String ROW_KEY
See Also:
Constant Field Values
Constructor Detail

GlueScheduledJobInfoLogger

public GlueScheduledJobInfoLogger()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
setter method for DI.

Parameters:
dataSource -

getName

public String getName()
Specified by:
getName in interface org.quartz.JobListener

jobToBeExecuted

public void jobToBeExecuted(org.quartz.JobExecutionContext context)
Job이 실행되기 직전에 호출되는 메소드. Scheduled Job 정보를 DB에 등록한다. (참고, jobWasExecuted 메소드가 호출되는 시점에 상태(STATE)정보를 "Completed"으로 변경한다.)

Specified by:
jobToBeExecuted in interface org.quartz.JobListener
Parameters:
context -

jobExecutionVetoed

public void jobExecutionVetoed(org.quartz.JobExecutionContext context)
job 수행이 거부될 때 호출된다.

Specified by:
jobExecutionVetoed in interface org.quartz.JobListener

jobWasExecuted

public void jobWasExecuted(org.quartz.JobExecutionContext context,
                           org.quartz.JobExecutionException jobException)
Job 실행이 완료되면 호출되는 메소드. 'jobToBeExecuted' 메소드에서 생성한 Row를 찾아서 정보를 업데이트한다.

Specified by:
jobWasExecuted in interface org.quartz.JobListener
Parameters:
jobException - job exception
context - job context

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception


Copyright © 2013–2016 POSCO ICT. All rights reserved.