Examples of InterceptorChain


Examples of org.infinispan.interceptors.InterceptorChain

      // Execute the prepare on both nodes
      LocalTransaction localTx = txTable.getLocalTransaction(tm(c1).getTransaction());
      txCoordinator.prepare(localTx);

      // Delay the commit on the remote node. Can't used blockNewTransactions because we don't want a StateTransferInProgressException
      InterceptorChain c2ic = TestingUtil.extractComponent(c2, InterceptorChain.class);
      c2ic.addInterceptorBefore(new CommandInterceptor() {
         protected Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable {
            if (command instanceof CommitCommand) {
               Thread.sleep(3000);
            }
            return super.handleDefault(ctx, command);
View Full Code Here

Examples of org.jahia.services.content.interceptor.InterceptorChain

        return r;
    }

    public InterceptorChain getInterceptorChain() {
        if (interceptorChain == null) {
            interceptorChain = new InterceptorChain();
            interceptorChain.setInterceptors(interceptors);
        }
       
        return interceptorChain;
    }
View Full Code Here

Examples of org.jboss.cache.interceptors.InterceptorChain

   }

   private void replaceInternal()
   {
      ComponentRegistry componentRegistry = TestingUtil.extractComponentRegistry(cache);
      InterceptorChain ic = componentRegistry.getComponent(InterceptorChain.class);
      List<CommandInterceptor> commands = ic.getInterceptorsWhichExtend(BaseRpcInterceptor.class);
      for (CommandInterceptor interceptor: commands)
      {
         ReplicationQueue original = (ReplicationQueue) TestingUtil.extractField(BaseRpcInterceptor.class, interceptor, "replicationQueue");
         TestingUtil.replaceField(new ReplicationQueueDelegate(original),"replicationQueue", interceptor, BaseRpcInterceptor.class);
         log("replaced replicationQueue in " + interceptor.getClass());
View Full Code Here

Examples of org.jboss.cache.interceptors.InterceptorChain

      {
         cr.wireDependencies(i);
      }
      while ((i = i.getNext()) != null);

      InterceptorChain inch = cr.getComponent(InterceptorChain.class);
      inch.setFirstInChain(interceptor);
   }
View Full Code Here

Examples of org.jboss.cache.interceptors.InterceptorChain

   }

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

Examples of org.jboss.cache.interceptors.InterceptorChain

      icInterceptor = create(InvocationContextInterceptor.class);
      invalidationInterceptor = create(InvalidationInterceptor.class);
      txInterceptor = create(TxInterceptor.class);
      pessimisticInterceptor = create(PessimisticLockInterceptor.class);
      callInterceptor = create(CallInterceptor.class);
      chain = new InterceptorChain(icInterceptor);
   }
View Full Code Here

Examples of org.jboss.cache.interceptors.InterceptorChain

   {
      invalidationInterceptor.setNext(txInterceptor);
      txInterceptor.setNext(pessimisticInterceptor);
      pessimisticInterceptor.setNext(callInterceptor);

      InterceptorChain chain = new InterceptorChain(invalidationInterceptor);
      List<CommandInterceptor> expectedList = new ArrayList<CommandInterceptor>();
      expectedList.add(invalidationInterceptor);
      expectedList.add(txInterceptor);
      expectedList.add(pessimisticInterceptor);
      expectedList.add(callInterceptor);

      assert chain.asList().equals(expectedList);
   }
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.