Attività di post-migrazione
Al termine del processo di migrazione dei servizi J2C, potrebbero essere necessarie alcune attività di post-migrazione.
A seconda del tipo di programma di cui viene eseguita la migrazione, possono essere necessarie alcune procedure di post-migrazione.
- Codice personalizzazione utente: dal momento che lo strumento di migrazione non effettua la migrazione del codice di personalizzazione utente, è necessario adattare il codice precedente al nuovo progetto.
- Gestore formato messaggi: se viene utilizzato un gestore formato messaggi nel codice dell'applicazione client, è necessario sostituire i riferimenti a formatHandler. In alterativa, è necessario utilizzare il bean di input o di output generato per ottenere direttamente le dimensioni byte. Il codice seguente fornisce un esempio:
// ---------------------------------------------------
// 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);
- Risorse aggiuntive: se si desidera generare ulteriori risorse, ad esempio servizi Web, EJB o JSP, è possibile richiamare la pagina Web, il servizio Web e gli EJB dalla procedura guidata Bean Java J2C.