WebSphere Application Server, Version 6.1   
             オペレーティング・システム: AIX , HP-UX, Linux, Solaris, Windows, Windows Vista

             目次と検索結果のパーソナライズ化

プログラミングによるアプリケーションの開始

アプリケーションの開始は、管理コンソール、 wsadmin ツール、またはプログラミングによって行うことができます。この例を使用し、プログラミングによってアプリケーションを 開始します。

始める前に

このタスクでは、MBean プログラミングに関する基本的な知識があることが前提になっています。MBean プログラミングについては、MBean Java アプリケーション・プログラミング・インターフェース (API) 資料を参照してください。

WebSphere Application Server 上でアプリケーションを開始する前に、まずアプリケーションをインストールする必要があります。

このタスクについて

以下のタスクを実行し、プログラミングによってアプリケーションを開始します。

プロシージャー

  1. 管理クライアントを WebSphere Application Server に接続します。
  2. アプリケーション管理プロキシーを作成します。
  3. アプリケーション名、およびオプションでアプリケーションを開始するターゲットのリスト を渡すことによって、プロキシー上で startApplication メソッドを呼び出します。

結果

コードが正常に実行されると、アプリケーションが開始されます。

以下の例には、リストされた前のステップに従ったアプリケーションの開始方法が示されています。 一部のステートメントは印刷目的のために複数行に分割されています。

//Do a get of the administrative client to connect to
//WebSphere Application Server.

AdminClient client = ...;
String appName = "myApp";
Hashtable prefs = new Hashtable();
// Use the AppManagement MBean to start and stop applications on all or some targets.

// The AppManagement MBean is on server1 in WebSphere Application Server.			
// Query and get the AppManagement MBean.
ObjectName on = new ObjectName ("WebSphere:type=AppManagement,*");
Iterator iter = client.queryNames (on, null).iterator();
ObjectName appmgmtON = (ObjectName)iter.next();
			
//Start the application on all targets.
AppManagement proxy = AppManagementProxy.getJMXProxyForClient(client);
String started = proxy.startApplication(appName, prefs, null);
System.out.println("Application started on folloing servers: " + started);
			
//Start the application on some targets.
//String targets = "WebSphere:cell=cellname,node=nodename,server=servername+WebSphere:cell=cellname,cluster=clusterName";
//String started1 = proxy.startApplication(appName, targets, prefs, null);
//System.out.println("Application started on following servers: " + started1)



関連タスク
スクリプトによるアプリケーションの開始
関連資料
エンタープライズ・アプリケーション・コレクション
タスク・トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 5:05:53 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tjmx_start_app.html