WebSphere Extended Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS

長時間実行スケジューラーとの WebSphere スケジューラーの使用

長時間実行スケジューラー Enterprise JavaBean (EJB) インターフェースは、 長時間実行ジョブをプログラマチックに実行依頼および操作するために使用します。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
長時間実行スケジューラーに対する Web サービス・インターフェースおよび EJB インターフェース

Concept topic    

Terms of Use | Feedback Last updated: Mar 20, 2006 12:32:00 PM 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.
This information center is powered by Eclipse technology. (http://www.eclipse.org)