Examples of InvocationContextContainer


Examples of org.infinispan.context.InvocationContextContainer

   }

   public static void replicateCommand(Cache cache, VisitableCommand command) throws Throwable {
      ComponentRegistry cr = extractComponentRegistry(cache);
      InterceptorChain ic = cr.getComponent(InterceptorChain.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);
      InvocationContext ctxt = icc.createInvocationContext(true, -1);
      ic.invoke(ctxt, command);
   }
View Full Code Here

Examples of org.infinispan.context.InvocationContextContainer

      if (reducer == null)
         throw new NullPointerException("A valid reference of Reducer is not set " + reducer);
           
      ComponentRegistry registry = cache.getComponentRegistry();
      RpcManager rpc = cache.getRpcManager();
      InvocationContextContainer icc = cache.getInvocationContextContainer();
      DistributionManager dm = cache.getDistributionManager();
      InterceptorChain invoker = registry.getComponent(InterceptorChain.class);
      CommandsFactory factory = registry.getComponent(CommandsFactory.class);
     
      MapReduceCommand cmd = null;
View Full Code Here

Examples of org.infinispan.context.InvocationContextContainer

   }

   public static void replicateCommand(Cache cache, VisitableCommand command) throws Throwable {
      ComponentRegistry cr = extractComponentRegistry(cache);
      InterceptorChain ic = cr.getComponent(InterceptorChain.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);
      InvocationContext ctxt = icc.createInvocationContext(true, -1);
      ic.invoke(ctxt, command);
   }
View Full Code Here

Examples of org.infinispan.context.InvocationContextContainer

   }

   public void testChangesOnAtomicMapNoLocks() {
      AtomicMap<String, String> map = cache.getAtomicMap("key");
      assert map.isEmpty();
      InvocationContextContainer icc = TestingUtil.extractComponent(cache, InvocationContextContainer.class);
      InvocationContext ic = icc.createInvocationContext();
      ic.setFlags(SKIP_LOCKING);
      log.debug("Doing a put");
      assert icc.getInvocationContext().hasFlag(SKIP_LOCKING);
      map.put("a", "b");
      log.debug("Put complete");
      assert map.get("a").equals("b");

      // now re-retrieve the map and make sure we see the diffs
View Full Code Here

Examples of org.infinispan.context.InvocationContextContainer

   @BeforeMethod
   public void setUp() {
      n = new CacheNotifierImpl();
      mockCache = createNiceMock(Cache.class);
      EasyMock.replay(mockCache);
      InvocationContextContainer icc = new InvocationContextContainerImpl();
      n.injectDependencies(icc, mockCache);
      cl = new CacheListener();
      n.start();
      n.addListener(cl);
      ctx = new NonTxInvocationContext();
View Full Code Here

Examples of org.infinispan.context.InvocationContextContainer

   }

   public static void replicateCommand(Cache cache, VisitableCommand command) throws Throwable {
      ComponentRegistry cr = extractComponentRegistry(cache);
      InterceptorChain ic = cr.getComponent(InterceptorChain.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);
      InvocationContext ctxt = icc.createInvocationContext();
      ic.invoke(ctxt, command);
   }
View Full Code Here

Examples of org.infinispan.invocation.InvocationContextContainer

            log.warn("Cache named [{0}] exists but isn't in a state to handle invocations.  Its state is {1}.", cacheName, cr.getStatus());
            return RequestIgnoredResponse.INSTANCE;
         }
      }

      InvocationContextContainer icc = cr.getLocalComponent(InvocationContextContainer.class);
      CommandsFactory commandsFactory = cr.getLocalComponent(CommandsFactory.class);

      // initialize this command with components specific to the intended cache instance
      commandsFactory.initializeReplicableCommand(cmd);

      try {
         Object retval = cmd.perform(icc.get());
         return cr.getComponent(ResponseGenerator.class).getResponse(cmd, retval);
      } catch (Exception e) {
         return new ExceptionResponse(e);
      }
   }
View Full Code Here

Examples of org.jboss.cache.invocation.InvocationContextContainer

@Test(groups = {"unit", "mvcc"}, testName = "util.concurrent.locks.OwnableReentrantLockTest")
public class OwnableReentrantLockTest
{
   private InvocationContextContainer getInvocationContextContainer()
   {
      InvocationContextContainer icc = new InvocationContextContainer();
      icc.injectContextFactory(new MVCCContextFactory());
      return icc;
   }
View Full Code Here

Examples of org.jboss.cache.invocation.InvocationContextContainer

      return icc;
   }

   public void testReentrancyThread()
   {
      InvocationContextContainer icc = getInvocationContextContainer();
      OwnableReentrantLock lock = new OwnableReentrantLock(icc);

      lock.lock(); // locked by current thread
      assert lock.getOwner().equals(Thread.currentThread());
      assert lock.getHoldCount() == 1;
View Full Code Here

Examples of org.jboss.cache.invocation.InvocationContextContainer

      assert lock.getHoldCount() == 0;
   }

   public void testReentrancyGtx()
   {
      InvocationContextContainer icc = getInvocationContextContainer();
      OwnableReentrantLock lock = new OwnableReentrantLock(icc);

      // create and set a gtx
      GlobalTransaction gtx = new GlobalTransaction();
      gtx.setId(10);
      icc.get().setGlobalTransaction(gtx);

      lock.lock(); // locked by current thread
      assert lock.getOwner().equals(gtx);
      assert lock.getHoldCount() == 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.