messageMediator.setReplyExceptionDetailMessage(msg);
}
public void endRequest(Broker broker, Object self, InputObject inputObject)
{
ORB orb = (ORB)broker ;
try {
if (orb.subcontractDebugFlag) {
dprint(".endRequest->");
}
// Note: the inputObject may be null if an error occurs
// in request or before _invoke returns.
// Note: self may be null also (e.g., compiler generates null in stub).
MessageMediator messageMediator =
orb.getInvocationInfo().getMessageMediator();
if (messageMediator != null)
{
if (messageMediator.getConnection() != null)
{
((CorbaMessageMediator)messageMediator)
.sendCancelRequestIfFinalFragmentNotSent();
}
// Release any outstanding NIO ByteBuffers to the ByteBufferPool
InputObject inputObj = messageMediator.getInputObject();
if (inputObj != null) {
inputObj.close();
}
OutputObject outputObj = messageMediator.getOutputObject();
if (outputObj != null) {
outputObj.close();
}
}
// XREVISIT NOTE - Assumes unregistering the waiter for
// location forwards has already happened somewhere else.
// The code below is only going to unregister the final successful
// request.
// NOTE: In the case of a recursive stack of endRequests in a
// finally block (because of Remarshal) only the first call to
// unregisterWaiter will remove the waiter. The rest will be
// noops.
unregisterWaiter(orb);
// Invoke Portable Interceptors cleanup. This is done to handle
// exceptions during stream marshaling. More generally, exceptions
// that occur in the ORB after send_request (which includes
// after returning from _request) before _invoke:
orb.getPIHandler().cleanupClientPIRequest();
// REVISIT: Early replies?
} catch (IOException ex) {
// See CDRInput/OutputObject.close() for more info.
// This won't result in a Corba error if an IOException happens.