@Override public <T> T execute(final Command<T> command) { ProcessApplicationIdentifier processApplicationIdentifier = ProcessApplicationContextImpl.get(); if (processApplicationIdentifier != null) { // clear the identifier so this interceptor does not apply to nested commands ProcessApplicationContextImpl.clear(); try { ProcessApplicationReference reference = getPaReference(processApplicationIdentifier); return Context.executeWithinProcessApplication(new Callable<T>() { @Override public T call() throws Exception { return next.execute(command); } }, reference); } finally { // restore the identifier for subsequent commands ProcessApplicationContextImpl.set(processApplicationIdentifier); } } else { return next.execute(command); } }
@Override public <T> T execute(final Command<T> command) { ProcessApplicationIdentifier processApplicationIdentifier = ProcessApplicationContextImpl.get(); if (processApplicationIdentifier != null) { // clear the identifier so this interceptor does not apply to nested commands ProcessApplicationContextImpl.clear(); try { ProcessApplicationReference reference = getPaReference(processApplicationIdentifier); return Context.executeWithinProcessApplication(new Callable<T>() { @Override public T call() throws Exception { return next.execute(command); } }, reference); } finally { // restore the identifier for subsequent commands ProcessApplicationContextImpl.set(processApplicationIdentifier); } } else { return next.execute(command); } }
@Override public <T> T execute(final Command<T> command) { ProcessApplicationIdentifier processApplicationIdentifier = ProcessApplicationContextImpl.get(); if (processApplicationIdentifier != null) { // clear the identifier so this interceptor does not apply to nested commands ProcessApplicationContextImpl.clear(); try { ProcessApplicationReference reference = getPaReference(processApplicationIdentifier); return Context.executeWithinProcessApplication(new Callable<T>() { @Override public T call() throws Exception { return next.execute(command); } }, reference); } finally { // restore the identifier for subsequent commands ProcessApplicationContextImpl.set(processApplicationIdentifier); } } else { return next.execute(command); } }