Package org.jboss.cache

Examples of org.jboss.cache.InvocationContext


    * 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()} and setting the origin local flag to its default value.
    */
   public Object invoke(VisitableCommand cacheCommand) throws Throwable
   {
      InvocationContext ctxt = invocationContextContainer.get();
      return cacheCommand.acceptVisitor(ctxt, firstInChain);
   }
View Full Code Here


      }
   }

   private void assertInvocationContextInitState(Cache<Object, Object> c)
   {
      InvocationContext ctx = c.getInvocationContext();
      InvocationContext control;
      control = ctx.copy();

      control.reset();

      assertEquals("Should be equal", control, ctx);
   }
View Full Code Here

      });

      interceptorInvokedLatch.await();

      // check that the context on the test interceptor is correct.
      InvocationContext ctx = testInterceptor.ctx;
      interceptorResumeLatch.countDown();

      assert ctx.getMethodCall().getMethodId() == PutKeyValueCommand.METHOD_ID;
      assert ctx.getMethodCall().getArgs()[0] == null; // gtx
      assert ctx.getMethodCall().getArgs()[1].equals(Fqn.fromString("/a")); // fqn
      assert ctx.getMethodCall().getArgs()[2].equals("k"); // key
      assert ctx.getMethodCall().getArgs()[3].equals("v"); // value
      assert ctx.getMethodCall().getArgs()[4] == Boolean.FALSE; //last boolean value
   }
View Full Code Here

      assertInvocationContextInitState(cache2);
   }

   private void assertInvocationContextInitState(Cache c)
   {
      InvocationContext ctx = c.getInvocationContext();
      InvocationContext control;
      control = ctx.copy();

      control.reset();

      assertEquals("Should be equal", control, ctx);
   }
View Full Code Here

   private void removeFromTreeCache(Fqn fqn, boolean localOnly) throws Exception
   {
      if (localOnly)
      {
         InvocationContext ctx = cache.getInvocationContext();
         Option option = new Option();
         option.setCacheModeLocal(true);
         ctx.setOptionOverrides(option);
      }
      cache.removeNode(fqn);
   }
View Full Code Here

      }
   }

   private void assertInvocationContextInitState(Cache<Object, Object> c)
   {
      InvocationContext ctx = c.getInvocationContext();
      InvocationContext control;
      control = ctx.copy();

      control.reset();

      assertEquals("Should be equal", control, ctx);
   }
View Full Code Here

   private void removeFromTreeCache(Fqn fqn, boolean localOnly) throws Exception
   {
      if (localOnly)
      {
         InvocationContext ctx = cache.getInvocationContext();
         Option option = new Option();
         option.setCacheModeLocal(true);
         ctx.setOptionOverrides(option);
      }
      cache.removeNode(fqn);
   }
View Full Code Here

   private boolean executeRemove(GlobalTransaction gtx, Fqn toRemove) throws Throwable
   {
      Object result;
      RemoveNodeCommand removeBackupCommand = commandsFactory.buildRemoveNodeCommand(gtx, toRemove);

      InvocationContext ctx = invoker.getInvocationContext();
      ctx.getOptionOverrides().setCacheModeLocal(true);
      result = invoker.invoke(ctx, removeBackupCommand);
      return result != null && (Boolean) result;
   }
View Full Code Here

      Object callResults = null;
      try
      {
         if (trace) log.trace("Clustered get: invoking call with Fqn " + dataCommand.getFqn());
         InvocationContext ctx = interceptorChain.getInvocationContext();
         ctx.setOriginLocal(false);
         ctx.setBypassUnmarshalling(true);
         callResults = interceptorChain.invoke(ctx, dataCommand);
         Set mapCallRes;
         if (dataCommand instanceof GetChildrenNamesCommand && (mapCallRes = (Set) callResults) != null && mapCallRes.isEmpty())
            callResults = null;
         boolean found = validResult(callResults);
View Full Code Here

      Boolean active = localActivity.get();
      try
      {
         localActivity.set(Boolean.TRUE);
         // If need be, gravitate
         InvocationContext ictx = cache.getInvocationContext();
         ictx.setOptionOverrides(getGravitateOption());
         entry = (StatefulBeanContext) cache.get(id, "bean");
      }
      catch (CacheException e)
      {
         RuntimeException re = convertToRuntimeException(e);
View Full Code Here

TOP

Related Classes of org.jboss.cache.InvocationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.