![[z/OS]](../images/ngzos.gif)
アウトバウンド API と外部アドレス・スペースまたはサブシステムの併用
アウトバウンド API と外部アドレス・スペースまたはサブシステムとの間の対話を作成する場合、このタスクを使用します。
始める前に
手順
タスクの結果
重要: RMLT またはグローバル・トランザクションを使用するときに、CICS アプリケーションが RMLT またはグローバル・トランザクション中に同期点を発行する場合、サーバー・タスクは同期点操作中に BBOX 異常終了を発行します。これにより、同期点が失敗し、ASPx 異常終了が CICS によって生成されます。CICS アプリケーションは、(LocalTransaction オブジェクト上の commit または rollback メソッドを呼び出すことによって、または Java EE アプリケーション・コンポーネントが終了してから) WebSphere Application Server が同期点操作を実行するのを待機する必要があります。
重要: グローバル・トランザクション・コンテキストまたは RMLT が WebSphere から CICS にインポートされたときに、CICS トランザクションを実行できる最大時間を定義する場合は、CICS リンク・サーバー・リンク・タスクを開始するために使用されるトランザクション定義上の OTSTIMEOUT パラメーター値を変更します。デフォルトでは、トランザクション名は BBO# です。CICS トランザクションの実行時間が OTSTIMEOUT パラメーターによって指定された時間を超える場合は、CICS トランザクションを実行している CICS タスクが異常終了し、グローバル・トランザクションまたは RMLT 全体がロールバックします。トランザクション定義上の OTSTIMEOUT パラメーターをコーディングする方法については、「CICS Transaction Server for z/OS Resource Definition Guide」を参照してください。
ご使用の Java EE アプリケーション・コンポーネントが RMLT またはグローバル・トランザクションに参加していて、キーワード TXN=N を使用して開始されたバッチ・プログラムまたは CICS リンク・サーバーとアプリケーションが通信している場合、最適化されたローカル・アダプターは、ターゲット・プログラムへの接続を確立できません。ターゲット・プログラムは、Java EE アプリケーションが必要とするトランザクション機能を提供できません。例外がマイナー・コード 0xC9C24C3B と共に表示されます。このコードは、ターゲット登録名が見つかったが、トランザクションに対して使用可能でないことを示します。キーワード TXN=Y を使用して使用可能に設定された CICS リンク・サーバーのみが、WebSphere Application Server for z/OS からのトランザクションの伝搬をサポートできます。
例
次のメソッドは、入力データおよび出力データをバイト配列 (byte[]) として使用する対話を開始する方法を示しています。
public byte[] driveInteraction(javax.resource.cci.ConnectionFactory cf,
javax.resource.cci.Connection con,byte[] inputDataBytes),throws javax.resource.ResourceException
{
// Create an interaction using the optimized local adapter connection
javax.resource.cci.Interaction i = con.createInteraction();
// The InteractionSpec describes the service we want to call
com.ibm.websphere.ola.InteractionSpecImpl isi = new com.ibm.websphere.ola.InteractionSpecImpl();
isi.setServiceName("MYSERVICE");
// The input data is specified using an IndexedRecord. The first
// slot in the indexed record contains the input data bytes.
javax.resource.cci.RecordFactory rf = cf.getRecordFactory();
javax.resource.cci.IndexedRecord ir = rf.createIndexedRecord(null);
ir.add(inputDataBytes);
// The interaction returns another IndexedRecord, whose first
// slot contains the output data bytes.
javax.resource.cci.Record or = i.execute(isi, ir);
byte[] outputDataBytes = null;
if (or != null)
{
outputDataBytes = (byte[])((javax.resource.cci.IndexedRecord)or).get(0);
}
// Return the output data to the caller
return outputDataBytes;
}
次のメソッドは、Rational® Application Developer によって生成されたコピーブック Record オブジェクトを使用して対話を開始する方法を示しています。
/**
* An example of driving an optimized local adapter interaction, using a Rational
* Application Developer copybook mapping class as input (inputRecord) and receiving
* a Rational Application Developer copybook mapping as output.
*/
public javax.resource.cci.Record driveInteraction(
javax.resource.cci.Connection con,
javax.resource.cci.Record inputRecord)
throws javax.resource.ResourceException
{
// Create an interaction using the OLA connection
javax.resource.cci.Interaction i = con.createInteraction();
// The InteractionSpec describes the service we want to call com.ibm.websphere.ola.InteractionSpecImpl isi =
new com.ibm.websphere.ola.InteractionSpecImpl();
isi.setServiceName("MYSERVICE");
// The Rational Application Developer generated copybook implements
// javax.resource.cci.Record and can be passed directly to the interaction.
// The interaction returns an IndexedRecord, whose first slot contains
// the output data bytes.
javax.resource.cci.Record or = i.execute(isi, inputRecord);
javax.resource.cci.Record outputRecord = null;
if (or != null)
{
// In this example, RADGeneratedOutputType is the name of the Rational Application Developer
// generated copybook mapping class.
outputRecord = new RADGeneratedOutputType();
// The output bytes are stored in the output record returned on the
// interaction, which is an IndexedRecord.
byte[] outputDataBytes =
(byte[])((javax.resource.cci.IndexedRecord)or).get(0);
// To convert the output bytes to another Rational Application Developer generated copybook,
// call the setBytes(byte[]) method of that class. The class will
// implement the com.ibm.etools.marshall.RecordBytes interface.
((com.ibm.etools.marshall.RecordBytes)outputRecord)
.setBytes(outputDataBytes);
}
// Return the output data to the caller
return outputRecord;
}