178 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
Figure 6-44 Edit environment variables
3. Expand the com.ibm.dse.samples.appl package to find the
startupServerOpBean.java and startupServerOp.java file. Implement their
execute( ) methods:
For com.ibm.dse.samples.appl.startupServerOpBean.java, add
private String sessionID = null;
private Hashtable result = new Hashtable();
private Context aContext, parentContext, rootCtx;
See Figure 6-45 on page 179.
Chapter 6. Post-migration activities 179
Figure 6-45 Implement execute methods
Modify the execute() method. Change the following:
public Hashtable execute() throws BTTSAEException, Exception {
Hashtable result = new Hashtable();
//user code here
return result;
}
This should now look as follows:
public Hashtable execute(BTTSystemData sysData, String wksContext,String
wksParentContext) throws BTTSAEException, Exception {
Hashtable result = new Hashtable();
//user code here
try {
initialize(sysData);
setupSessionContext();
result.put("InstanceID", getInstanceId());
close();
} catch (BTTSAEException ex) {
ex.printStackTrace();
throw new DSEInvalidRequestException(DSEException.critical,
getClass().getName(),
"Not able to create the session context " +
" in " + getName() + " \n" + ex.toString());
}
return result;
}
180 IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines
For startupServerOp.java, modify the execute() method. Change the
following:
public Hashtable execute()
throws BTTSAEException, Exception, java.rmi.RemoteException;
This should look as follows:
public Hashtable execute(BTTSystemData sysData,String wksContext,String
wksParentContext) throws BTTSAEException, Exception,
java.rmi.RemoteException;
See Figure 6-46
Figure 6-46 Execute method for startupServerOp.java
For the source code, refer to the Appendix (Appendix A, “Branch
Transformation Toolkit development and runtime requirements” on page 477
and Appendix B, “Setting up a Branch Transformation Toolkit sample
application” on page 493).
4. In the same way, implement the execute( ) methods of the
endSessionServerOpBean.java and endSessionServerOp.java file:
For endSessionServerOpBean.java, modify the execute() method. Change
the following:
public Hashtable execute() throws BTTSAEException, Exception {
Hashtable result = new Hashtable();
//user code here
return result;
}
Chapter 6. Post-migration activities 181
This should look as follows:
public Hashtable execute(BTTSystemData sysData) throws
BTTSAEException,Exception {
initialize(sysData);
Hashtable result = new Hashtable();
Context sessionCtx ;
//if instanceID != null
if( getInstanceId() != null ){
// Removes the context and its parent (the parent session context)
sessionCtx = Context.getContextByInstanceID(getInstanceId());
if(sessionCtx instanceof Context)
sessionCtx.prune();
}
close();
return result;
}
For endSessionServerOp.java, modify the execute() method. Change the
following:
public Hashtable execute()
throws BTTSAEException, Exception, java.rmi.RemoteException;
This should look as follows:
public Hashtable execute(BTTSystemData sysData)
throws BTTSAEException, Exception, java.rmi.RemoteException;
For the source code, refer to the Appendix (Appendix A, “Branch
Transformation Toolkit development and runtime requirements” on page 477
and Appendix B, “Setting up a Branch Transformation Toolkit sample
application” on page 493).
5. Save all the changes. If any error exists in the BaseSampleEJB project,
choose the Java Build Path in the Properties window of the project and add
the JARs bttbase.jar, bttfmt.jar, and bttsvrbean.jar to the Libraries tab and
select the bttsvcinfra and UserDefineJar projects in the Projects tab.
6. Make sure that all the errors in the BaseSampleEJB project have been fixed
before deploying. Right-click the project, and from the pop-up menu, select
Generate Deployment and RMIC Code..., click Select All and Finish.

Get IBM Branch Transformation Toolkit 5.1 Migration and Usage Guidelines now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.