RECEIVE_REQUEST_SERVICE_CONTEXTS))
{
//an interceptor bailed out, so don't continue request
//processing and return here. The service contexts for
//the result have to be set, of course.
ReplyOutputStream out = request.getReplyOutputStream();
Collection<ServiceContext> ctx = info.getReplyServiceContexts ();
for (ServiceContext s: ctx)
{
out.addServiceContext(s);
}
return;
}
manager.setTSCurrent(info.current());
}
// TODO: The exception replies below should also trigger interceptors.
// Requires some re-arranging of the entire method.
if (Time.hasPassed (request.getRequestEndTime()))
{
request.setSystemException
(new org.omg.CORBA.TIMEOUT ("Request End Time exceeded",
0, CompletionStatus.COMPLETED_NO));
return;
}
if (checkReplyEndTime && Time.hasPassed (request.getReplyEndTime()))
{
request.setSystemException
(new org.omg.CORBA.TIMEOUT ("Reply End Time exceeded",
0, CompletionStatus.COMPLETED_NO));
return;
}
Time.waitFor (request.getRequestStartTime());
if (servantManager != null)
{
if (servantManager instanceof org.omg.PortableServer.ServantActivator)
{
invokeIncarnate();
}
else
{
invokePreInvoke();
}
((org.omg.CORBA_2_3.ORB)orb).set_delegate(servant);
}
if (servant != null)
{
if (info != null)
{
info.setServant(servant);
if (servant instanceof org.omg.CORBA.portable.InvokeHandler)
{
if(! invokeInterceptors(info,
ServerInterceptorIterator.RECEIVE_REQUEST ))
{
//an interceptor bailed out, so don't continue
//request processing and return here. The
//service contexts for the result have to be
//set, of course.
if( cookieHolder != null )
{
invokePostInvoke();
}
ReplyOutputStream out = request.getReplyOutputStream();
Collection<ServiceContext> ctx = info.getReplyServiceContexts ();
for (ServiceContext s: ctx)
{
out.addServiceContext(s);
}
return;
}
}
else if (servant instanceof org.omg.PortableServer.DynamicImplementation)
{
request.setServerRequestInfo(info);
}
}
invokeOperation();
}
// preinvoke and postinvoke are always called in pairs
// but what happens if the servant is null
if (cookieHolder != null)
{
invokePostInvoke();
}
if (checkReplyEndTime && Time.hasPassed (request.getReplyEndTime()))
{
request.setSystemException
(new org.omg.CORBA.TIMEOUT ("Reply End Time exceeded after invocation",
0, CompletionStatus.COMPLETED_YES));
}
if (info != null)
{
InterceptorManager manager =
orb.getInterceptorManager();
info.setCurrent (manager.getCurrent());
short op = 0;
switch(request.status().value())
{
case ReplyStatusType_1_2._NO_EXCEPTION:
{
op = ServerInterceptorIterator.SEND_REPLY;
info.setReplyStatus (SUCCESSFUL.value);
break;
}
case ReplyStatusType_1_2._USER_EXCEPTION:
{
info.setReplyStatus (USER_EXCEPTION.value);
Any sendingException = orb.create_any();
SystemExceptionHelper.insert(sendingException, new org.omg.CORBA.UNKNOWN("Stream-based UserExceptions are not available!"));
info.sending_exception(sendingException);
op = ServerInterceptorIterator.SEND_EXCEPTION;
break;
}
case ReplyStatusType_1_2._SYSTEM_EXCEPTION:
{
info.setReplyStatus (SYSTEM_EXCEPTION.value);
Any sendingException = orb.create_any();
SystemExceptionHelper.insert(sendingException, request.getSystemException());
info.sending_exception(sendingException);
op = ServerInterceptorIterator.SEND_EXCEPTION;
break;
}
case ReplyStatusType_1_2._LOCATION_FORWARD:
{
info.setReplyStatus (LOCATION_FORWARD.value);
op = ServerInterceptorIterator.SEND_OTHER;
break;
}
}
invokeInterceptors(info, op);
ReplyOutputStream out = request.get_out();
Collection<ServiceContext> ctx = info.getReplyServiceContexts ();
for (ServiceContext s: ctx)
{
out.addServiceContext(s);
}
manager.removeTSCurrent();
}
}