Information Technology Reference
In-Depth Information
public String newOrder
(final String agentID, final String customerID, final Set orderSet)
throws RemoteException, PlaceOrderException;
S AMPLE 14. Signature of newOrder .
public String newOrder (String p0, String p1, Set p2)
throws RemoteException, PlaceOrderException
{
PVCSSBContext context = null;
final TxMethodToken token = preInvoke(TransactionAttribute.REQUIRED);
retVal = null;
try {
context = getHome().getPooledSessionContext();
retVal = getBean(context).newOrder(p0, p1, p2); // business logic
}
catch (PlaceOrderException e) {
postInvoke(TransactionAttribute.REQUIRED, token);
throw e;
}
catch (Throwable e) {
postInvoke(TransactionAttribute.REQUIRED, token, e);
}
finally {
getHome().replaceContext(context);
}
// no exception -- commit if necessary
postInvoke(TransactionAttribute.REQUIRED, token);
return (retVal);
}
S AMPLE 15. newOrder for connected container.
When deployed in a connected environment, the container's tooling generates an
implementation that interacts with the container to provide container services to the
component. Such tooling is obviously container-specific, and the code shown in Sam-
ple 15 is only meant to show how the deployed bean delegates business logic to the
original bean implementation.
Sample 16 shows how the ManageOrder SSB is deployed to a disconnected con-
tainer. As the deployed component executes, it has exactly the same semantics as the
connected version of the application. This is because the container does not modify
Search WWH ::




Custom Search