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 writes out available
// resource types on the broker that have the 
// ability to emit resource-level statistics. 
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	String[] resourceNames = b.getResourceTypeNames();
	for (String thisResource : resourceNames) {
		System.out.println(thisResource);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
特定のリソース・タイプに関連付けられているリソース名の確認
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and writes out resource property
// names reported for a specific resource type.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	String[] resourcePropertyNames = 
				b.getResourceTypeStatisticsPropertyNames("JVM");
	for (String thisResourceProperty : resourcePropertyNames) {
		System.out.println(thisResourceProperty);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
統計の収集の開始
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then enables resource 
// statistics for all the execution group's resource types.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		eg.setResourceStatisticsEnabled(null, true);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
統計の収集の停止
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then disables resource 
// statistics for all the execution group's resource types.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		eg.setResourceStatisticsEnabled(null, false);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
統計の収集状況の表示
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then writes out if resource 
// statistics is enabled.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		System.out.println(eg.getResourceStatisticsEnabled(null));
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック

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

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


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