* @author Roman Smirnov
*/
public class DefaultDelegateInterceptor implements DelegateInterceptor {
public void handleInvocation(final DelegateInvocation invocation) throws Exception {
BaseDelegateExecution contextExecution = invocation.getContextExecution();
ProcessApplicationReference processApplication = ProcessApplicationContextUtil.getTargetProcessApplication((CoreExecution) contextExecution);
if (processApplication != null && ProcessApplicationContextUtil.requiresContextSwitch(processApplication)) {
Context.executeWithinProcessApplication(new Callable<Void>() {