Because the service class inherits from TuxedoJavaServer, you can call
getTuxAppContext() in the service to get the context object. However, you cannot get
TuxAppContext in
tpsvrinit() because the
TuxAppContext is not ready at this time. If you try to get the
TuxAppContext object in
tpsvrinit(),
tpsvrinit() will fail and throw an exception.
TuxAppContext myAppCtxt = null;
TypedString rqstData = new TypedString("hello”);
TuxATMIReply rply = null;
myAppCtxt = getTuxAppContext();
cd = myAppCtxt.tpacall("data_process", rqstData, 0);
rply = myAppCtxt.tpgetrply(cd, 0);
} catch (TuxATMITPException ex) {
TuxAppContext myAppCtxt = null;
TypedString rqstData = new TypedString("hello”);
TuxATMIReply rply = null;
myAppCtxt = getTuxAppContext();
rply = myAppCtxt.tpcall("data_process", rqstData, 0);
} catch (TuxATMITPException ex) {
TuxAppContext myAppCtxt = null;
TypedFML32 rqstData = (TypedFML32)rqst.getServiceData();
TuxATMIReply rply = null;
TypedFML32 rplyData = null;
myAppCtxt = getTuxAppContext();
rply = myAppCtxt.tpcall("data_process", rqstData, 0);
rplyData = (TypedFML32)rply.getReplyBuffer();
myAppCtxt.tpreturn(TPSUCCESS, 0, rplyData, 0);
} catch (TuxATMITPException ex) {
TuxAppContext myAppCtxt = null;
TypedFML32 rqstData = (TypedFML32)rqst.getServiceData();
TuxATMIReply rply = null;
TypedFML32 rplyData = null;
myAppCtxt = getTuxAppContext();
rply = myAppCtxt.tpcall("data_process", rqstData, 0);
rplyData = (TypedFML32)rply.getReplyBuffer();
myAppCtxt.tpforward("FWD_SVC", rplyData, 0);
} catch (TuxATMITPException ex) {
rtn = TuxAppContextUtil.tpappthrinit(tpinfo);
TuxAppContext myAppCtxt = null;
myAppCtxt = TuxAppContextUtil.getTuxAppContext();
TuxATMIReply rply = null;
TypedString rqStr = new TypedString("Is_is_simple_appThread_test");
rply = myAppCtxt.tpcall("SVC", rqStr, TPNOTIME|TPSIGRSTRT);
rtn = TuxAppContextUtil.tpappthrterm();