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