if (useSessionBean) {
//The action will be done by the Session bean
if (localSessionBean) {
//Invoke the session bean through the local interface
logger.log(BasicLevel.DEBUG, "Use local session bean");
StoreServicesLocal lstoreServices = null;
try {
lstoreServices = lstoreServicesLH.create();
} catch (CreateException e) {
logger.log(BasicLevel.ERROR, "Error during the creation of Local Session", e);
throw new ServletException(e);
}
try {
executeSessionBean(req, resp, lstoreServices, pmh);
} finally {
//release the session bean from the pool
lstoreServices.remove();
}
} else {
//Invoke the session bean through the Remote interface
logger.log(BasicLevel.DEBUG, "Use remote session bean");
StoreServicesRemote lstoreServices = null;
try {
lstoreServices = lstoreServicesRH.create();
} catch (CreateException e) {
logger.log(BasicLevel.ERROR, "Error during the creation of Local Session", e);
throw new ServletException(e);
}
try {
executeSessionBean(req, resp, lstoreServices);
} finally {
//release the session bean from the pool
lstoreServices.remove();
}
}
} else {
logger.log(BasicLevel.DEBUG, "Use direct call");
executeDirectCall(req, resp, pmh);