log.trace("Not supported work context class : " + context.getClass().getName());
}
fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
throw new WorkCompletedException("Unsupported WorkContext class : " + context.getClass().getName(),
WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
}
// Duplicate checks
else
{
// TransactionContext duplicate
if (isTransactionContext(contextType))
{
if (isTransactionContext)
{
if (trace)
{
log.trace("Duplicate transaction work context : " + context.getClass().getName());
}
fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
throw new WorkCompletedException("Duplicate TransactionWorkContext class : " +
context.getClass().getName(), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
}
else
{
isTransactionContext = true;
}
}
// SecurityContext duplicate
else if (isSecurityContext(contextType))
{
if (isSecurityContext)
{
if (trace)
{
log.trace("Duplicate security work context : " + context.getClass().getName());
}
fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
throw new WorkCompletedException("Duplicate SecurityWorkContext class : " +
context.getClass().getName(),
WorkContextErrorCodes.DUPLICATE_CONTEXTS);
}
else
{
isSecurityContext = true;
}
}
// HintContext duplicate
else if (isHintContext(contextType))
{
if (isHintcontext)
{
if (trace)
{
log.trace("Duplicate hint work context : " + context.getClass().getName());
}
fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
throw new WorkCompletedException("Duplicate HintWorkContext class : " +
context.getClass().getName(),
WorkContextErrorCodes.DUPLICATE_CONTEXTS);
}
else
{
isHintcontext = true;
}
}
// Normally, this must not be happened!i just safe check!
else
{
fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
throw new WorkCompletedException("Unsupported WorkContext class : " +
context.getClass().getName(),
WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
}
}