J2C サービスのマイグレーション・プロセスの完了後に、事後マイグレーション・タスクを実行しなければならない場合があります。
始める前に
マイグレーションするプログラムのタイプに応じて、なんらかの事後マイグレーション・ステップが必要になることがあります。
手順
- ユーザー・カスタマイズ・コード: マイグレーション・ツールはユーザー・カスタマイズ・コードをマイグレーションしないので、
新規プロジェクトに合わせてこのコードを改良する必要があります。
- メッセージ・フォーマット・ハンドラー: クライアント・アプリケーション・コードでメッセージ・フォーマット・ハンドラーを使用している場合は、
formatHandler への参照を置換する必要があります。
代わりに、生成済みの入力または出力 Bean を使用してバイト・サイズを直接取得する必要があります。
以下に、コードの例を示します。
// ---------------------------------------------------
// Populate the IMS transaction input message with
// data. Use the input message format handler method
// getSize() to set the LL field of the input message.
// ---------------------------------------------------
//INPUTMSGFormatHandler inFmtHndlr =new INPUTMSGFormatHandler();
//INPUTMSG input = (INPUTMSG) inFmtHndlr.getObjectPart();
// input.setIn__ll((short) inFmtHndlr.getSize());
//new J2C code
INPUTMSG input = new INPUTMSG();
input.setIn__ll((short) input.getSize());
// ---------------------------------------------------
// Retrieve the multi-segment output message as a
// byte array using the output message format
// handler method getBytes().
// ---------------------------------------------------
// OutMsgFormatHandler outFmtHndlr =
// (OutMsgFormatHandler) output._getFormatHandler();
// segBytes = outFmtHndlr.getBytes();
//new J2C code
segBytes = output.getBytes();
//-----old wsadie code----------------------------------------------
// Create and populate segment object from byte array.
//-------------------------------------------------------------------------
//OUTPUTSEG1FormatHandler outSeg1FH =
//new OUTPUTSEG1FormatHandler();
// outSeg1FH.setBytes(buff);
//OUTPUTSEG1 S1 =
//(OUTPUTSEG1) outSeg1FH.getObjectPart();
//new J2C code
OUTPUTSEG1 S1 = new OUTPUTSEG1();
S1.setBytes(buff);
- 追加成果物: JSP、EJB、Web サービスなどの追加成果物を生成する場合は、
「J2C Java™ Bean」ウィザードから Web ページ、Web サービス、EJB を呼び出すことによって生成することができます。