@Override
public ContextHandle saveContext(ContextService contextService, Map<String, String> contextObjectProperties) {
// Capture the current thread context
ClassLoader contextClassloader = null;
AppServSecurityContext currentSecurityContext = null;
ComponentInvocation savedInvocation = null;
if (classloading) {
contextClassloader = Utility.getClassLoader();
}
if (security) {
currentSecurityContext = securityContext.getCurrentSecurityContext();
}
ComponentInvocation currentInvocation = invocationManager.getCurrentInvocation();
if (currentInvocation != null) {
savedInvocation = createComponentInvocation(currentInvocation);
}
// TODO - support workarea propagation
return new InvocationContext(savedInvocation, contextClassloader, currentSecurityContext);