WebSphere Extended Deployment, Version 6.0.x     운영 체제: AIX, HP-UX, Linux, Solaris, Windows, z/OS

장기간 실행 스케줄러에서 WebSphere 스케줄러 사용

장기간 실행 스케줄러 EJB(Enterprise JavaBean) 인터페이스는 프로그램을 통해 장기간 실행 작업을 제출 및 조작할 때 사용됩니다. EJB 인터페이스는 WebSphere 스케줄러와 함께 사용하여 장기간 실행 작업을 달력에 기반하여 제출할 수 있습니다. 이 섹션에서는 WebSphere Application Server의 기본 스케줄러를 사용하여 장기간 실행 스케줄러에 장기간 실행 작업을 제출하는 방법을 설명합니다.

이 타스크를 위한 단계

  1. 스케줄러를 작성 및 구성하십시오. 스케줄러 작성 및 구성 방법에 대한 정보는 타스크 개발 및 스케줄링을 참조하십시오.
  2. 장기간 실행 작업을 제출할 스케줄러 타스크를 작성하십시오. 이 스케줄러 타스크에서는 장기간 실행 스케줄러 EJB를 호출하여 장기간 실행 작업을 제출합니다. EJB를 호출하는 타스크를 작성하는 경우 관련 지시사항은 WebSphere Application Server 버전 6.0 InfoCenter의 세션 Bean을 호출하는 타스크 개발 주제를 참조하십시오. 이 주제에는 WebSphere 스케줄러의 달력 기능 사용과 관련된 지시사항도 들어 있습니다. 다음은 장기간 실행 스케줄러 EJB를 호출하는 방법에 대한 타스크 코드 예제입니다.
    // These are the import statements needed by the Task
    import javax.naming.*;
    
    import com.ibm.websphere.longrun.JobScheduler;
    import com.ibm.websphere.longrun.JobSchedulerHome
    
    
    private JobSchedulerHome zjsHome = null;
    private JobScheduler zjs = null;
    
    
    public void process(TaskStatus task) ()
    try{
    
         //ensure that the xJCL can be placed in a String, eg: by reading an xJCL
         //file into a String.
         String xJCL = <xJCL as a string>;
    
         //obtain cell level naming Context
         InitialContext ctxt = new InitialContext();
            Hashtable env = new Hashtable();
    
         env.put(Context.INITIAL_CONTEXT_FACTORY,
               "com.ibm.websphere.naming.WsnInitialContextFactory");
    
         env.put(Context.PROVIDER_URL,"corbaloc:rir:/NameServiceCellRoot");
         ctxt = new InitialContext(env);
    
         //in order to lookup the LRS EJB from the cell context in the namespace,
         //the name context to the Application Server or cluster to which the LRS
         //application is deployed has to be provided.
         //Eg: “nodes/myNode/servers/myServer” or “clusters/myCluster”.
    
         String longRunningContext = <long_running_context>;
    
    
         zjsHome = (JobSchedulerHome) ctxt.lookup(longRunningContext +
         "/ejb/com/ibm/websphere/longrun/JobSchedulerHome");
         zjs = zjsHome.create();
         zjs.submitJob( xJCL );
    
    }catch (Exception e) {
    System.out.println(e.getMessage());
    }
    
  3. 장기간 실행 작업을 제출할 스케줄러 타스크를 스케줄하십시오. WebSphere Application Server 버전 6.0 InfoCenter에 있는 스케줄러로 타스크 제출 문서를 참조하십시오.



Related concepts
장기간 실행 스케줄러에 대한 웹 서비스 및 EJB 인터페이스

개념 주제    

이용 약관 | 피드백 마지막 갱신 날짜: Mar 21, 2006 11:34:03 AM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=?topic=/com.ibm.websphere.xd.doc/info/scheduler/cxdbgusweb.html

© Copyright IBM 2005, 2006. All Rights Reserved.
이 Information Center는 Eclipse 테크놀러지로 강화되었습니다. (http://www.eclipse.org)