WSDM リソース用の WebSphere Application Server モニターの作成 (非推奨)
バージョン 6.1 Feature Pack for Web Services で提供される Web Services Distributed Management (WSDM) モニター・サポートは、外部管理ソフトウェアを使用します。 しかし、WSDM 用のカスタム WebSphere® Application Server モニターを作成する方が便利です。このタスクを使用して、Java API for XML Web Services (JAX-WS) プログラミング・モデルを基にした WSDM モニターを作成します。
始める前に


このタスクについて
手順
タスクの結果
コード例を使用すると、SOAP 会話コード例などのカスタム・モニターを作成する際に役立ちます。
これらのコード例に加え、サーブレット・リソースの統計の取得に使用できる組み込みコード・サンプルが製品内にあります。 このサンプルを実行するには、java –classpath wsdm-demo.jar;<your_JAX-WS_thin_client_install_directory>/com.ibm.jaxws.thinclient_8.5.0.jar samples.wsdm.servlet.WsdmDemo を実行します。
SOAP 会話例
以下のコード例は、使用可能なすべてのリソースを要求する方法を示します。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://test.ibm.com:8080/websphere-management/services/service-group</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyRequest</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:2f1abf03-ef3e-0837-b8e6-d34dc8e352e2</wsa:MessageID>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address></wsa:From>
<muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter=
"true">MuseResource-1</muse-wsa:ResourceId>
</soap:Header>
<soap:Body>
<wsrf-rp:GetResourceProperty xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" xmlns:wsrf-sg=
"http://docs.oasis-open.org/wsrf/sg-2">wsrf-sg:Entry</wsrf-rp:GetResourceProperty>
</soap:Body>
</soap:Envelope>
以下は、wsrf-sg:Entry XML エレメントとして表される 2 つの使用可能なリソースを持つ応答の例です。
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:soapenc="http:www.w3.org/2003/05/soap-encoding"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<wsa:To>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyResponse</wsa:Action>
<wsa:MessageID>uuid:4eda30ea-c8ca-2998-2c9f-e2519175a1aa</wsa:MessageID>
<wsa:RelatesTo RelationshipType="wsa:Reply">uuid:2f1abf03-ef3e-0837-b8e6-d34dc8e352e2</wsa:RelatesTo>
<wsa:From>
<wsa:Address>http://test.ibm.com:8080/websphere-management/services/service-group</wsa:Address>
<wsa:ReferenceParameters><muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing" IsReferenceParameter="true">
MuseResource-1</muse-wsa:ResourceId></was:From>
<was:RelatesTo>uuid:2f1abf03-ef3e-0837-b8e6-d34dc8e352e2</was:RelatesTo>
</env:Header>
<env:Body>
<wsrf-rp:GetResourcePropertyResponse xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
<wsrf-rp:Entry xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2"
<wsrf-sg:ServiceGroupEntryEPR
<wsa:Address> "http://test.ibm.com:8080/websphere-management/services/service-group-entry</wsa:Address>
<wsa:ReferenceParameters><muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-103</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsrf-sg:ServiceGroupEntryEPR>
<wsrf-sg:MemberServiceEPR>
<wsa:Address>http://test.ibm.com:8080/websphere-management/services/ejb</wsa:Address>
<wsa:ReferenceParameters>
<was-wsdm:WAS_Resource_Type>
<was-wsdm:WAS_Resource_ManagedNodeID xmlns:was-wsdm="http://ibm.com/2006/v1.3"
<was-wsdm:WAS_Resource_Type xmlns:was-wsdm="http://ibm.com/2006/v1.3">ejb <was-wsdm:WAS_Resource_MbeanIdentifier
xmlns:was-wsdm="http://ibm.com/2006/v1.3">
WebSphere:name=EjbClient,process=server1,Application=jms-client,platform=dynamicproxy,J2EEApplication=jms-client,node=
Node01,J2EEName=jms-client#jms-ejb-client.jar#EjbClient,j2eeType=StatelessSessionBean,J2EEServer=server1,Server=server1,version=
7.0.0.0,type=StatelessSessionBean,mbeanIdentifier=jms-client#jms-ejb-client.jar#EjbClient,EJBModule=jms-ejb-client.jar,cell=
Cell01,spec=1.0</was-wsdm:WAS_Resource_MbeanIdentifier>
<was-wsdm:WAS_Resource_MRID xmlns:was-wsdm="http://ibm.com/2006/v1.3">
ejb:WebSphere:name=EjbClient,process=server1,Application=jms-client,platform=dynamicproxy,J2EEApplication=jms-client,node=
Node01,J2EEName=jms-client#jms-ejb-client.jar#EjbClient,j2eeType=StatelessSessionBean,J2EEServer=server1,Server=server1,version=
7.0.0.0,type=StatelessSessionBean,mbeanIdentifier=jms-client#jms-ejb-client.jar#EjbClient,EJBModule=jms-ejb-client.jar,cell=
Cell01,spec=1.0</was-wsdm:WAS_Resource_MRID>
</wsa:ReferenceParameters>
</wsrf-sg:MemberServiceEPR>
<wsrf-sg:Content/>
</wsrf-sg:Entry>
<wsrf-sg:Entry xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2">
<wsrf-sg:ServiceGroupEntryEPR><wsa:Address>http://test.ibm.com:8080/websphere-management/services/service-group-entry</wsa:Address>
<wsa:ReferenceParameters><muse-wsa:ResourceId xmlns:mus-wsa="http://ws.apache.org/muse/addressing"<MuseResource-97</muse-wsa:
ResourceId></wsa:ReferenceParameters>
</wsrf-sg:ServiceGroupEntryEPR>
<wsrf-sg:MemberServiceEPR>
<wsa:Address>http://test.ibm.com:8080/websphere-management/services/datasource</wsa:Address>
<wsa:ReferenceParameters>
<was-wsdm:WAS_Resource_ManagedNodeID xmlns:was-wsdm="http://ibm.com/2006/v1.3"/>
<was-wsdm:WAS_Resource_Type xmlns:was-wsdm="http://ibm.com/2006/v1.3">datasource</was-wsdm:WAS_Resource_Type>
<was-wsdm:WAS_Resource_MbeanIdentifier xmlns:was-wsdm="http://ibm.com/2006/v1.3">WebSphere:name=Default Datasource,process=
server1,platform=dynamicproxy,node=Node01,JDBCProvider=Derby JDBC Provider,diagnosticProvider=true,j2eeType=JDBCDataSource,J2EEServer=
server1,Server=server1,version=7.0.0.0,type=DataSource,mbeanIdentifier=cells/Cell01/nodes/Node01/servers/server1/resources.xml#DataSource_1,
JDBCResource=Derby JDBC Provider,cell=Cell01,spec=1.0</was-wsdm:WAS_Resource_MbeanIdentifier>
<was-wsdm:WAS_Resource_MRID xmlns:was-wsdm="http://ibm.com/2006/v1.3">datasource:WebSphere:name=Default Datasource,process=
server1,platform=dynamicproxy,node=Node01,JDBCProvider=Derby JDBC Provider,diagnosticProvider=true,j2eeType=JDBCDataSource,J2EEServer=
server1,Server=server1,version=7.0.0.0,type=DataSource,mbeanIdentifier=cells/Cell01/nodes/Node01/servers/server1/resources.xml#DataSource_1,
JDBCResource=Derby JDBC Provider,cell=Cell01,spec=1.0</was-wsdm:WAS_Resource_MRID>
</wsa:ReferenceParameters>
</wsrf-sg:MemberServiceEPR>
<wsrf-sg:Content/>
</wsrf-sg:Entry>
</wsrf-rp:GetResourcePropertyResponse>
</env:Body>
</env:Envelope>
以下の例は、サーブレット・リソースから concurrentRequests メトリックを要求する方法を示しています。ここで関心の対象となるリソースは、SOAP ヘッダーで参照パラメーターとして指定されています。これらのパラメーターは、太字のフォントで表示してあります。
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://test.ibm.com:8080/websphere-management/services/servlet</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/
GetResourcePropertyRequest</wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:2737b4e1-31af-5b0d-cb6e-17e2c812ffbb</wsa:MessageID>
<wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
</wsa:From>
<wsa-wsdm:WAS_Resource_ManagedNodeID xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter=
"true" xmlns:was-wsdm="http://ibm.com/2006/v1.3">
<was-wsdm:WAS_Resource_Type xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter="true" xmlns:was-wsdm=
"http://ibm.com/2006/v1.3">
servlet</was-wsdm:WAS_Resource_Type>
<was-wsdm:WAS_Resource_MbeanIdentifier xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter="true"
xmlns:was-wsdm="http://ibm.com/2006/v1.3">WebSphere:WebModule=WSDMUtil.war,name=ejb,process=server1,Application=
wsdm-util,platform=dynamicproxy,J2EEApplication=wsdm-util,node=Node01,J2EEName=wsdm-util#WSDMUtil.war#ejb,j2eeType=
Servlet,J2EEServer=server1,Server=server1,version=7.0.0.0,type=Servlet,mbeanIdentifier=wsdm-util#WSDMUtil.war#ejb,cell=
Cell01,spec=1.0</was-wsdm:WAS_Resource_MbeanIdentifier>
<was-wsdm:WAS_Resource_MRID xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter="true" xmlns:was-wsdm=
"http://ibm.com/2006/v1.3">servlet:WebSphere:WebModule=WSDMUtil.war,name=ejb,process=server1,Application=wsdm-util,platform=
dynamicproxy,J2EEApplication=wsdm-util,node=Node01,J2EEName=wsdm-util#WSDMUtil.war#ejb,j2eeType=Servlet,J2EEServer=server1,Server=
server1,version=7.0.0.0,type=Servlet,mbeanIdentifier=wsdm-util#WSDMUtil.war#ejb,cell=Cell01,spec=1.0</was-wsdm:WAS_Resource_MRID>
<soap:Body>
<wsrf-rp:GetResourceProperty xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2" xmlns:servlet=
"http://www.ibm.com/xmlns/prod/websphere/management/j2ee/servlet">servlet:ConcurrentRequests</wsrf-rp:GetResourceProperty>
</soap:Body>
</soap:Envelope>
以下は、サーバー応答の例です。
正確なリソースは SOAP ヘッダーで識別され、メトリックは SOAP 本体で使用可能です。
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xsd="http://www.w3.org/20001/XMLSchema-instance">
<env:Header>
<wsa:To>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
<wsa:Action>http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyResponse</wsa:Action>
<wsa:MessageID>uuid:91400c29-8c50-9f62-7df2-1bb0212083f1</wsa:MessageID>
<wsa:RelatesTo RelationshipType="wsa:Reply">uuid:2737b4e1-31af-5b0d-cb6e-17e2c812ffbb</wsa:RelatesTo>
<wsa:From>
<wsa:Address>http://test.ibm.com:8080/websphere-management/services/servlet</wsa:Address>
<wsa:ReferenceParameters>
<was-wsdm:WAS_Resource_ManagedNodID xmlns:was-wsdm="http://ibm.com/2006/v1.3" IsReferenceParameter="true"
<was-wsdm:WAS_Resource_Type xmlns:was-wsdm="http://ibm.com/2006/v1.3" IsReferenceParameter="true">servlet</was-wsdm:WAS_Resource_Type>
<was-wsdm:WAS_Resource_MbeanIdentifier xmlns:was-wsdm="http://ibm.com/2006/v1.3" IsReferenceParameter="true">
WebSphere:WebModule=WSDMUtil.war,name=ejb,process=server1,Application=wsdm-util,platform=dynamicproxy,J2EEApplication=wsdm-util,node=
Node01,J2EEName=wsdm-util#WSDMUtil.war#ejb,j2eeType=Servlet,J2EEServer=server1,Server=server1,version=7.0.0.0,type=
Servlet,mbeanIdentifier=wsdm-util#WSDMUtil.war#ejb,cell=Cell01,spec=1.0</was-wsdm:WAS_Resource_MbeanIdentifier>
<was-wsdm:WAS_Resource_MRID xmlns:was-wsdm="http://ibm.com/2006/v1.3" IsReferenceParameter="true">servlet:WebSphere:WebModule=
WSDMUtil.war,name=ejb,process=server1,Application=wsdm-util,platform=dynamicproxy,J2EEApplication=wsdm-util,node=Node01,J2EEName=
wsdm-util#WSDMUtil.war#ejb,j2eeType=Servlet,J2EEServer=server1,Server=server1,version=7.0.0.0,type=Servlet,mbeanIdentifier=
wsdm-util#WSDMUtil.war#ejb,cell=Cell01,spec=1.0</was-wsdm:WAS_Resource_MRID>
</wsa:ReferenceParameters>
</wsa:From>
<wsa:RelatesTo>uuid:2737b4e1-31af-5b0d-cb6e-17e2c812ffbb</wsa:RelatesTo>
</env:Header>
<env:Body>
<wsrf-rp:GetResourcePropertyResponse xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
<servlet:ConcurrentRequests
xmlns:servlet="http://www.ibm.com/xmlns/prod/websphere/management/j2ee/servlet>11</servlet:ConcurrentRequests>
</wsrf-rp:GetResourcePropertyResponse>
</env:Body>
</env:Envelope>