![[z/OS]](../images/ngzos.gif)
외부 주소 공간 또는 서브시스템에 아웃바운드 API 사용
아웃바운드 API와 외부 주소 공간 또는 서브시스템 간의 상호작용을 작성하려면 이 태스크를 사용하십시오.
시작하기 전에
프로시저
결과
주의: RMLT 또는
글로벌 트랜잭션을 사용할 때 CICS 애플리케이션이
RMLT 또는 글로벌 트랜잭션 중 동기점을 발행하면 서버 태스크가
동기점 중에 BBOX 이상 종료를 발행합니다. 이로 인해 동기점이 실패하고
CICS에서 ASPx 이상 종료가
생성됩니다. CICS
애플리케이션은 WebSphere Application Server가
LocalTransaction 오브젝트에 커미트 또는 롤백 메소드를 호출하거나
Java EE 애플리케이션 컴포넌트를
완료시켜서 동기점 조작을 발행할 때까지
기다려야 합니다.
주의: CICS 트랜잭션이 실행할 수 있는
최대 시간을 정의하려면 글로벌 트랜잭션 컨텍스트 또는 RMLT를
WebSphere에서
CICS로 가져올 때,
CICS 링크 서버 링크 태스크를 시작하는 데
사용되는 트랜잭션 정의의 OTSTIMEOUT 매개변수값을
수정하십시오. 기본적으로 트랜잭션 이름은 BBO#입니다. CICS
트랜잭션 런타임이 OTSTIMEOUT 매개변수에 지정된
시간을 초과하는 경우 CICS 트랜잭션을
실행 중인 CICS 태스크가
이상 종료되어 전체 글로벌 트랜잭션 또는 RMLT가
롤백됩니다. 트랜잭션 정의에
OTSTIMEOUT 매개변수를 코딩하는 방법에 대한 정보는 z/OS용
CICS Transaction Server
자원 정의 안내서의 내용을 참조하십시오.
Java EE 애플리케이션 컴포넌트가 RMLT 또는 글로벌 트랜잭션에 참여 중이며 애플리케이션이 일괄처리 프로그램 또는 키워드 TXN=N으로 시작된 CICS 링크 서버와 통신 중이면, 최적화된 로컬 어댑터 연결이 대상 프로그램에 연결을 설정할 수 없습니다. 대상 프로그램이 Java EE 애플리케이션에 필요한 트랜잭션 기능을 제공할 수 없습니다. 마이너 코드 0xC9C24C3B의 예외가 표시됩니다. 이 코드는 대상 등록 이름이 있지만 트랜잭션에 사용되지 않음을 표시합니다. 키워드 TXN=Y로 사용 가능하게 된 CICS 링크 서버만 z/OS용 WebSphere Application Server로부터의 트랜잭션을 전파를 지원할 수 있습니다.
예
다음 메소드는 바이트 배열(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 생성 카피북 레코드 오브젝트를 사용하여 상호작용을 시작하는 방법을 보여줍니다.
/**
* 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;
}