/** * Walks the command through the interceptor chain. The received ctx is being passed in. */ @SuppressWarnings("deprecation") public Object invoke(InvocationContext ctx, VisitableCommand command) { ctx.setCommand(command); try { return command.acceptVisitor(ctx, firstInChain); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); return null; } catch (CacheException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Throwable t) { throw new CacheException(t); } }
/** * Handles a commit or a rollback. Called by the synch handler. Simply tests that we are in the correct tx and * passes the meth call up the interceptor chain. * * @throws Throwable */ @SuppressWarnings("deprecation") private Object handleCommitRollback(InvocationContext ctx, VisitableCommand command) throws Throwable { GlobalTransaction gtx = ctx.getGlobalTransaction(); Object result; VisitableCommand originalCommand = ctx.getCommand(); ctx.setCommand(command); try { result = invokeNextInterceptor(ctx, command); } finally { ctx.setCommand(originalCommand); ctx.setMethodCall(null); } if (trace) log.trace("Finished local commit/rollback method for " + gtx); return result; }
ctx.setCommand(prepareCommand); try ctx.setCommand(originalCommand); ctx.setMethodCall(null);
ctx.setCommand(null); ctx.setMethodCall(null);