/** * Similar to {@link #invoke(org.jboss.cache.InvocationContext , org.jboss.cache.commands.VisitableCommand)}, but * constructs a invocation context on the fly, using {@link InvocationContextContainer#get()} */ public Object invokeRemote(VisitableCommand cacheCommand) throws Throwable { InvocationContext ctxt = invocationContextContainer.get(); ctxt.setOriginLocal(false); return cacheCommand.acceptVisitor(ctxt, firstInChain); }
ctx.setOriginLocal(false); ctx.setBypassUnmarshalling(true); callResults = interceptorChain.invoke(ctx, dataCommand);
public void beforeCompletion() { if (trace) log.trace("Running beforeCompletion on gtx " + gtx); if (transactionContext == null) { log.error("Transaction has a null transaction entry - beforeCompletion() will fail."); throw new IllegalStateException("cannot find transaction entry for " + gtx); } modifications = transactionContext.getModifications(); ctx = invocationContextContainer.get(); setTransactionalContext(tx, gtx, transactionContext, ctx); if (ctx.isOptionsUninitialised() && transactionContext.getOption() != null) { ctx.setOptionOverrides(transactionContext.getOption()); } assertCanContinue(); ctx.setOriginLocal(false); }
/** * Generates NodeAdded notifications for all nodes of the tree. This is * called whenever the tree is initially retrieved (state transfer) */ private void notifyAllNodesCreated(InvocationContext ctx, InternalNode curr) { if (curr == null) return; ctx.setOriginLocal(false); cache.getNotifier().notifyNodeCreated(curr.getFqn(), true, ctx); cache.getNotifier().notifyNodeCreated(curr.getFqn(), false, ctx); // AND notify that they have been modified!! if (!curr.getKeys().isEmpty()) { cache.getNotifier().notifyNodeModified(curr.getFqn(), true, NodeModifiedEvent.ModificationType.PUT_MAP, Collections.emptyMap(), ctx); cache.getNotifier().notifyNodeModified(curr.getFqn(), false, NodeModifiedEvent.ModificationType.PUT_MAP, curr.getData(), ctx); } ctx.setOriginLocal(true); Set<InternalNode> children = curr.getChildren(); for (InternalNode n : children) notifyAllNodesCreated(ctx, n); }
/** * Sets the state of the InvocationContext based on the template context passed in * * @param template template to copy from */ public void setState(InvocationContext template) { if (template == null) { throw new NullPointerException("Template InvocationContext passed in to InvocationContext.setState() passed in is null"); } this.setGlobalTransaction(template.getGlobalTransaction()); this.setLocalRollbackOnly(template.isLocalRollbackOnly()); this.setOptionOverrides(template.getOptionOverrides()); this.setOriginLocal(template.isOriginLocal()); this.setTransaction(template.getTransaction()); }
/** * Generates NodeAdded notifications for all nodes of the tree. This is * called whenever the tree is initially retrieved (state transfer) */ private void notifyAllNodesCreated(InvocationContext ctx, NodeSPI curr) { if (curr == null) return; ctx.setOriginLocal(false); cache.getNotifier().notifyNodeCreated(curr.getFqn(), true, ctx); cache.getNotifier().notifyNodeCreated(curr.getFqn(), false, ctx); // AND notify that they have been modified!! if (!curr.getKeysDirect().isEmpty()) { cache.getNotifier().notifyNodeModified(curr.getFqn(), true, NodeModifiedEvent.ModificationType.PUT_MAP, Collections.emptyMap(), ctx); cache.getNotifier().notifyNodeModified(curr.getFqn(), false, NodeModifiedEvent.ModificationType.PUT_MAP, curr.getDataDirect(), ctx); } ctx.setOriginLocal(true); Set<NodeSPI> children = curr.getChildrenDirect(); for (NodeSPI n : children) { notifyAllNodesCreated(ctx, n); } }
ctx.setOriginLocal(!remoteLocal); // this is the LOCAL sync handler after all!
private void processCommitLog(ObjectInputStream ois) throws Exception { Object object = cache.getMarshaller().objectFromObjectStream(ois); while (object instanceof LogEntry) { List<WriteCommand> mods = ((LogEntry)object).getModifications(); if (trace) log.trace("Mods = " + mods); for (WriteCommand mod : mods) { InvocationContext ctx = container.get(); ctx.setOriginLocal(false); ctx.getOptionOverrides().setCacheModeLocal(true); ctx.getOptionOverrides().setSkipCacheStatusCheck(true); chain.invoke(ctx, mod); } object = cache.getMarshaller().objectFromObjectStream(ois); } verifyMarker(object); }
try ctx.setOriginLocal(false); ctx.setOriginLocal(true);
ctx.setOriginLocal(false); ctx.getOptionOverrides().setCacheModeLocal(true); ctx.getOptionOverrides().setSkipCacheStatusCheck(true);
ctx.setOriginLocal(false); if (!componentRegistry.invocationsAllowed(false))