Quartz_Job의 jb 사용

2109 단어 quartz
1. job 인터페이스 클래스 Booking StatusJob 구현.java
package com.raymon.booking.job;

import java.util.Date;

import javax.naming.InitialContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;


public class BookingStatusJob implements Job {
	static Log log = LogFactory.getLog(BookingStatusJob.class);

	public void execute(JobExecutionContext context) throws JobExecutionException {
		log.info("Quartz-------:"+ (new Date()).toLocaleString());
	}

 2.프로파일
ejb-jar.xml
		<ejb-jar>
			<display-name>PullJobChangeStatus-ejb</display-name>
			<enterprise-beans>
				<message-driven>
					<ejb-name>BookingStatusJob</ejb-name>
					<ejb-class>com.raymon.booking.job.BookingStatusJob</ejb-class>
					<messaging-type>org.quartz.Job</messaging-type>
					<transaction-type>Container</transaction-type>
					<activation-config>
						<activation-config-property>
							<activation-config-property-name>cronTrigger</activation-config-property-name>
							<activation-config-property-value><![CDATA[0/15 * * * * ?]]></activation-config-property-value>
						</activation-config-property>
					</activation-config>
				</message-driven>
			</enterprise-beans>
	</ejb-jar>
	
	jboss.xml
		<jboss>
	    <enterprise-beans>
	        <message-driven>
	            <ejb-name>BookingStatusJob</ejb-name>
	            <resource-adapter-name>quartz-ra.rar</resource-adapter-name>
	        </message-driven>
	    </enterprise-beans>
		</jboss>

 
저는 jboss 서버를 사용합니다.

좋은 웹페이지 즐겨찾기