if (ri.isLocalInterceptor())
{
return;
}
// get SAS message
SASContextBody contextBody = null;
ServiceContext ctx = null;
try
{
ctx = ri.get_reply_service_context(SecurityAttributeService);
}
catch (BAD_PARAM e)
{
if (logger.isDebugEnabled())
logger.debug("No SAS security context found (exception): "+ri.operation());
}
catch (Exception e)
{
if (logger.isWarnEnabled())
logger.warn("No SAS security context found (exception): "+e);
}
if (ctx == null || ctx.context_data.length <= 1) return;
try
{
Any msg = codec.decode_value( ctx.context_data, SASContextBodyHelper.type() );
contextBody = SASContextBodyHelper.extract(msg);
}
catch (Exception e)
{
logger.error ("Could not parse SAS reply", e);
throw new org.omg.CORBA.NO_PERMISSION("SAS Could not parse SAS reply: " + e,
MinorCodes.SAS_CSS_FAILURE,
CompletionStatus.COMPLETED_MAYBE);
}
ClientConnection connection = ri.getConnection();
// process CompleteEstablishContext message
if (contextBody.discriminator() == MTCompleteEstablishContext.value)
{
CompleteEstablishContext reply = contextBody.complete_msg();
logger.debug("receive_exception MTCompleteEstablishContext: " + reply.client_context_id);
// if not stateful, remove from connection
if (reply.client_context_id > 0 && !reply.context_stateful)
connection.purgeSASContext(reply.client_context_id);
}
// process ContextError message
if (contextBody.discriminator() == MTContextError.value)
{
ContextError reply = contextBody.error_msg();
logger.debug("receive_exception MTContextError: " + reply.client_context_id);
// if stateful, remove from connection
if (reply.client_context_id > 0)
connection.purgeSASContext(reply.client_context_id);