WebSphere Message Broker バージョン 8.0.0.5 オペレーティング・システム: AIX、HP-Itanium、Linux、Solaris、Windows、z/OS

製品の最新バージョンについては、IBM Integration Bus バージョン 9.0 をご覧ください。

CMP アプリケーションでのアクティビティー・ログの処理

CMP アプリケーションでメッセージ・フローおよびリソース・タイプのアクティビティー・ログ項目を表示します。

始める前に:
CMP アプリケーションを作成して、アクティビティー・ログを調べたり分析したりできます。
アクティビティー・ログを生成可能なリソース・タイプを確認する
/*
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and lists the available
 * resource types on the execution group 'exgp' that can 
 *  generate アクティビティー・ログs.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if (b != null) {
    ExecutionGroupProxy e = b.getExecutionGroupByName("exgp");
    if (e != null) {
      Properties rms = new Properties();
      rms.setProperty(AttributeConstants.ACTIVITYLOG_SUPPORTED_PROPERTY, AttributeConstants.TRUE);
      Enumeration <ResourceManagerProxy> rmps = e.getResourceManagers(rms);
      while (rmps.hasMoreElements()) {
        ResourceManagerProxy rmp = rmps.nextElement();
        String name = rmp.getName();
        System.out.println(name);
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
}
特定のリソース・タイプのアクティビティー・ログ項目を取り出す
/*
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and retrieves and prints out アクティビティー・ログ
 * entries for resource type 'JMS' on execution group 'exgp'.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if (b != null) {
    ExecutionGroupProxy = b.getExecutionGroupByName("exgp");
    if (e != null) {
      ResourceManagerProxy rmp = e.getResourceManagerByName("JMS");
      if(rmp != null) {
        ActivityLogProxy al = rmp.getActivityLog();
        if (al != null) {
          for (int i = 1; i <= al.getSize(); i++) {
            ActivityLogEntry ale = al.getLogEntry(i);
            System.out.println(ale);
            System.out.println(ale.getMessageNumber());
          }
        }
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
}
特定のメッセージ・フローのアクティビティー・ログ項目を取り出す
/*	
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and gets references to the execution
 * group called 'default', the application belonging to this execution group called 'app', 
 * and the message flow in the application called 'msgflow'. 
 * It prints out the アクティビティー・ログ entries for message flow 'msgflow'.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if(b != null) {
    ExecutionGroupProxy e = b.getExecutionGroupByName("default");
    if (e != null) {
      ApplicationProxy ap = e.getApplicationByName("app");
      if (ap != null) {
        MessageFlowProxy mf = ap.getMessageFlowByName("msgflow");
        if(mf != null) {
          ActivityLogProxy al = mf.getActivityLog();
          if (al != null) {
            for (int i = 1; i <= al.getSize(); i++) {
              ActivityLogEntry ale = al.getLogEntry(i);
              System.out.println(ale);
              System.out.println(ale.getMessageNumber());
            }
          }
        }
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
	ex.printStackTrace();
} 
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

Copyright IBM Corporation 1999, 2014Copyright IBM Corporation 1999, 2014.

        
        最終更新:
        
        最終更新: 2015-02-28 17:49:16


タスク・トピックタスク・トピック | バージョン 8.0.0.5 | bj55160_