Oracle® Fusion Middleware Oracle WebLogic Server Tuxedo Connector 管理ガイド 11g リリース 1 (10.3.1) B55553-01 |
|
戻る |
次へ |
以下の節では、WebLogic Server アプリケーションと Tuxedo 環境の間の接続とサービスの管理方法について説明します。Oracle WebLogic Tuxedo Connector では、Tuxedo アクセス ポイント間の通信に必要な相互運用属性に類似した属性を使用します。
Administration Console または WLST スクリプト言語を使用して、個々の接続を動的に表示、開始、および停止できます。提供されているツールを使用して WTC サーバ接続を開始および停止する方法については、以下の節を参照してください。
Administration Console を使用して、Oracle WebLogic Tuxedo Connector 接続を開始および停止できます。WTC サーバ接続を開始および停止する方法については、Administration Console オンライン ヘルプを参照してください。
listConnectionsConfigured()
属性を使用してコンフィグレーションされた接続を表示したり、startConnection()
属性を使用して個々の接続を開始したり、stopConnection()
属性を使用して個々の接続を停止したりできます。個々の接続を動的に管理する方法については、『Oracle Fusion Middleware Oracle WebLogic Scripting Tool ガイド』を参照してください。
WebLogic Scripting Tool (WLST) で listConnectionsConfigured()
属性を使用して、ドメインの接続を動的に表示できます。cmo.listConnectionsConfigured()
を実行すると、DSessConnInfo
構造の配列への参照が返されます。これは、次のようにローカルの WLST 変数に格納するのが便利です。
wls:/mydomain/serverRuntime/WTCRuntime/WTCService> r=cmo.listConnectionsConfigured()
各 DSessConnInfo
インスタンスには、ローカル アクセス ポイント ID、リモート アクセス ポイント ID、およびステータス (ブール型、true = 接続、false = 非接続) があります。次に例を示します。
wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].getLocalAccessPointId() WLSDOM wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].getRemoteAccessPointId() TUXDOM wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].isConnected() 0
WebLogic Scripting Tool (WLST) で startConnection()
属性を使用して、アクセス ポイントの個々の接続を動的に開始できます。
1 つのローカル アクセス ポイントと 1 つのリモート アクセス ポイントの間の接続を開始するには、引数に両方のアクセス ポイント ID を指定します。次に例を示します。
cmo.startConnection('WLSDOM','TUXDOM')
1 つのローカル アクセス ポイントとすべての関連するリモート アクセス ポイントの間の接続を開始するには、引数にローカル アクセス ポイント ID を指定します。次に例を示します。
cmo.startConnection('WLSDOM')
WebLogic Scripting Tool (WLST) で stopConnection()
属性を使用して、アクセス ポイントの個々の接続を動的に停止できます。
1 つのローカル アクセス ポイントと 1 つのリモート アクセス ポイントの間の接続を停止するには、引数に両方のアクセス ポイント ID を指定します。次に例を示します。
cmo.stopConnection('WLSDOM','TUXDOM')
所定のローカル アクセス ポイントに関連するすべての接続を停止するには、引数にローカル アクセス ポイント ID を指定します。次に例を示します。
cmo.stopConnection('WLSDOM')
次のコード リストは、WLST を使用して接続を動的に表示、開始、および停止する例です。
コード リスト 4-1 接続の動的な表示、開始、および停止
java weblogic.WLST wls:/offline> connect('weblogic','welcome1') wls:/mydomain/serverConifg> cd('WTCServers') wls:/mydomain/serverConfig/WTCServers> cd('myWTC') wls:/mydomain/serverConfig/WTCServers/myWTC> cd('LocalTuxDoms') wls:/mydomain/serverConfig/WTCServers/myWTC/LocalTuxDoms> ls() dr-- TDOM2 wls:/mydomain/serverConfig/WTCServers/myWTC/LocalTuxDoms> cd('../../..') wls:/mydomain/serverConfig> serverRuntime() wls:/mydomain/serverRuntime> cd('WTCRuntime') wls:/mydomain/serverRuntime/WTCRuntime> cd('WTCService') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> r=cmo.listConnectionsConfigured() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].getLocalAccessPointId() TDOM2 wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].getRemoteAccessPointId() TDOM1 wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].isConnected() 0 wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.startConnection('TDOM2','TDOM1') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> r=cmo.listConnectionsConfigured() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].isConnected() 1 wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.stopConnection('TDOM2','TDOM1') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> r=cmo.listConnectionsConfigured() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print r[0].isConnected() 0 wls:/mydomain/serverRuntime/WTCRuntime/WTCService> disconnect() wls:/offline> exit()
WebLogic Scripting Tool (WLST) を使用して、コンフィグレーション属性を動的に変更できます。
次のコード リストは、setInteroperate()
属性を変更する例です。
コード リスト 4-2 コンフィグレーション属性の変更
java weblogic.WLST wls:/offline> connect('weblogic','welcome1') wls:/mydomain/serverConifg> edit() wls:/mydomain/edit> startEdit() wls:/mydomain/edit> cd("WTCServers/myWTC") wls:/mydomain/edit/WTCServers/myWTC> cd("LocalTuxDoms") wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms> cd("TDOM2") wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> cmo.setInteroperate("Yes") wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> validate() wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> showChanges() Changes that are in memory and saved to disc but not yet activated are: MBean Changed : mydomain:Name=TDOM2,Type=WTCLocalTuxDom,WTCServer=myWTC Operation Invoked : modify Attribute Modified : Interoperate Attributes Old Value : No Attributes New Value : Yes Server Restart Required : false wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> save() wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> activate(block="true") wls:/mydomain/edit/WTCServers/myWTC/LocalTuxDoms/TDOM2> disconnect() wls:/offline> exit()
WebLogic Server Administration Console または WLST を使用して、特定の WTC サーバ上のサービスを中断および再開できます。WTC サーバ上でインポートされたサービスが中断されると、WTC サーバに送信された、そのサービスに対するすべての JATMI クライアント リクエストは、TPException.TPENOENT を送出して即座に返されます。明示的に再開されるまで、そのサービスは使用可能になりません。
中断されているエクスポートされたサービスに割り当てられた、Tuxedo クライアントから WTC へのサービス リクエストの場合、そのサービス リクエストは実際のサービスを呼び出すことなく TPENOENT を出して返されます。すでに受信されたサービス リクエストや処理中のサービス リクエストは引き続き処理され、中断操作の影響を受けません。
WTC サービスを動的に中断および再開する方法については、「WTC サービスの動的な中断と再開」を参照してください。
提供されているツールを使用して WTC サービスを中断および再開する方法については、以下の節を参照してください。
Administration Console を使用して、Oracle WebLogic Tuxedo Connector サービスを中断および再開できます。WTC サービスを中断および再開する方法については、Administration Console オンライン ヘルプを参照してください。
WLST で WTCRuntimeMBean を介して、Oracle WebLogic Tuxedo Connector サービスを中断および再開できます。サービスのステータスをチェックすることもできます。
サービスのステータスを判別するには、引数に SvcName
、LDOM
、または RDomList
を指定します。次に例を示します。
int WTCService.getServiceStatus(String SvcName)
この場合、対象となる WTC サーバの SvcName
という名前を持つすべてのインポートされたサービスおよびエクスポートされたサービスのステータスが返されます。'SvcName'
という同じリソース名を持つインポートされたサービスまたはエクスポートされたサービスが複数ある場合、そのうち少なくとも 1 つのサービスが使用可能であれば、ステータスは AVAILABLE
が返されます。'SvcName'
という同じリソース名を持つインポートされたサービスまたはエクスポートされたサービスが複数あり、中断されているサービスと使用不能なサービスが混在している場合、ステータスは SUSPENDED
が返されます。すべてのサービスが使用不能の場合、ステータスは UNAVAILABLE
が返されます。一致するサービスが見つからない場合は、TPException.TPENOENT
が送出されます。
返されるステータスの有効な値を表 4-1 に示します。
WTC サーバによって公開されているインポートされたサービスまたはエクスポートされたサービスを中断できます。管理者によって中断されているサービスは、WTC サーバが再デプロイされるか、WLS サーバが再起動されるか、またはサービスが管理者によって再開されるときにのみ使用可能になります。
使用可能なサービスを中断するには、引数に SvcName
、LDOM
、または RDomList
を指定します。次に例を示します。
Void WTCRuntimeMBean.suspendService(String SvcName, boolean isImported)
この場合、指定された名前を持つすべてのインポートされたサービスまたはエクスポートされたサービスが中断されます。isImported
が true の場合はインポートされたサービスのみが中断され、false の場合はエクスポートされたサービスのみが中断されます。一致するサービスが見つからない場合は、TPException.TPENOENT
が送出されます。
WTC サーバによって公開されている、ステータスが SUSPENDED のインポートされたサービスまたはエクスポートされたサービスを再開できます。管理者によって中断されているサービスは、WTC サーバが再デプロイされるか、WLS サーバが再起動されるか、またはサービスが管理者によって再開されるときにのみ使用可能になります。
中断されているサービスを再開するには、引数に SvcName
、LDOM
、または RDomList
を指定します。次に例を示します。
void WTCRuntimeMBean.resumeService(String SvcName)
この場合、対象となる WTC サーバの SvcName
という名前を持つすべてのインポートされたサービスおよびエクスポートされたサービスが再開されます。一致するサービスが見つからない場合は、TPException.TPENOENT
が送出されます。
WebLogic Server Administration Console または WLST を使用して、特定の WTC サーバ上のサービスを中断および再開できます。WTC サーバ上でインポートされたサービスが中断されると、WTC サーバに送信された、そのサービスに対するすべての JATMI クライアント リクエストは、TPException.TPENOENT を送出して即座に返されます。明示的に再開されるまで、そのサービスは使用可能になりません。
動的なステータスはインポートされたサービスのみに適用されます。使用可能な、またはその可能性のある TDomain セッションが少なくとも 1 つあれば、インポートされたサービスは AVAILABLE になります。使用可能な TDomain セッションがない場合にのみ、SUSPENDED になります。WTCRemoteTuxDom
の接続ポリシー解決が ON_DEMAND
の場合、TDomain セッションは存在しなくても常に使用可能です。WTCRemoteTuxDom
の接続ポリシー解決が INCOMING_ONLY
または ON_STARTUP
の場合、TDomain セッションは、接続が確立され、その TDomain セッションが存在するときのみ使用可能になります。
次のコード リストは、WLST を使用して接続を動的に表示、開始、および停止する例です。
コード リスト 4-3 サービスの動的な中断および再開
java weblogic.WLST wls:/offline> connect('weblogic','welcome1','t3://localhost:7001') wls:/mydomain/serverConfig> serverRuntime() wls:/mydomain/serverRuntime> cd('WTCRuntime/WTCService') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> ls() -r-- Name WTCService -r-- ServiceStatus weblogic.wtc.gwt.DServiceInfo[weblogic.wtc.gwt.DServiceInfo@1947a96] -r-- Type WTCRuntime -r-x getServiceStatus Integer : String(java.lang.String),String(java.lang.String),String(java.lang.String) -r-x getServiceStatus Integer : String(localAccessPoint),String(svcName) -r-x getServiceStatus Integer : String(localAccessPoint),String(svcName),Boolean(isImport) -r-x getServiceStatus Integer : String(svcName) -r-x getServiceStatus Integer : String(svcName),Boolean(isImport) -r-x listConnectionsConfigured weblogic.wtc.gwt.DSessConnInfo[] : -r-x resumeService Void : String(localAccessPoint),String(remoteAccessPointList),String(svcName) -r-x resumeService Void : String(localAccessPoint),String(svcName) -r-x resumeService Void : String(localAccessPoint),String(svcName),Boolean(isImport) -r-x resumeService Void : String(svcName) -r-x resumeService Void : String(svcName),Boolean(isImport) -r-x startConnection Void : String(LDomAccessPointId) -r-x startConnection Void : String(LDomAccessPointId),String(RDomAccessPointId) -r-x stopConnection Void : String(LDomAccessPointId) -r-x stopConnection Void : String(LDomAccessPointId),String(RDomAccessPointId) -r-x suspendService Void : String(localAccessPoint),String(remoteAccessPointList),String(svcName) -r-x suspendService Void : String(localAccessPoint),String(svcName) -r-x suspendService Void : String(localAccessPoint),String(svcName),Boolean(isImport) -r-x suspendService Void : String(svcName) -r-x suspendService Void : String(svcName),Boolean(isImport) wls:/mydomain/serverRuntime/WTCRuntime/WTCService> status=cmo.getServiceStatus() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print status[0].getServiceName() TOUPPER wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.svcTypeToString(status[0].getServiceType()) IMPORT wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.statusToString(status[0].getStatus()) AVAILABLE wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.suspendService('TOUPPER') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> status=cmo.getServiceStatus() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.statusToString(status[0].getStatus()) SUSPENDED wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.resumeService('TOUPPER') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> status=cmo.getServiceStatus() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.statusToString(status[0].getStatus()) AVAILABLE wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print status[0].getServiceName() TOUPPER wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.suspendService('TDOM1','TOUPPER') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> status=cmo.getServiceStatus() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print status[0].getServiceName() TOUPPER wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.statusToString(status[0].getStatus()) SUSPENDED wls:/mydomain/serverRuntime/WTCRuntime/WTCService> cmo.resumeService('TDOM1','TOUPPER') wls:/mydomain/serverRuntime/WTCRuntime/WTCService> status=cmo.getServiceStatus() wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print status[0].getServiceName() TOUPPER wls:/mydomain/serverRuntime/WTCRuntime/WTCService> print weblogic.wtc.gwt.WTCServiceStatus.statusToString(status[0].getStatus()) AVAILABLE wls:/mydomain/serverRuntime/WTCRuntime/WTCService> wls:/mydomain/serverRuntime/WTCRuntime/WTCService> disconnect() wls:/offline> exit()