예: 기본 스케줄러 달력 사용

J2EE 애플리케이션에서 SIMPLE 및 CRON 달력을 사용할 수 있습니다.

기본 스케줄러 달력 사용은 기본 UserCalendarHome EJB(Enterprise JavaBeans) 홈 오브젝트 검색, UserCalendar Bean 작성 및 applyDelta() 메소드 호출을 포함합니다. SIMPLE 및 CRON 캘린더에 대한 구문뿐 아니라 applyDelta 메소드에 대한 세부사항은 UserCalendar 인터페이스 주제를 참조하십시오.

예:

import java.util.Date;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import com.ibm.websphere.scheduler.UserCalendar;
import com.ibm.websphere.scheduler.UserCalendarHome;

// Create an initial context
InitialContext ctx = new InitialContext();

// Lookup and narrow the default UserCalendar home.
UserCalendarHome defaultCalHome=(UserCalendarHome)
	PortableRemoteObject.narrow(ctx.lookup(
      UserCalendarHome.DEFAULT_CALENDAR_JNDI_NAME), 
	   UserCalendarHome.class);

// Create the default UserCalendar instance.
UserCalendar defaultCal = defaultCalHome.create();

// Calculate a date using CRON based on the current
// date and time.  Return the next date that is 
// Saturday at 2AM
Date newDate = 
    defaultCal.applyDelta(new Date(), 
        "CRON", "0 0 2 ? * SAT");

주제 유형을 표시하는 아이콘 참조 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tsch_usingcalendar
파일 이름:tsch_usingcalendar.html