Package org.jboss.cache.interceptors.base

Examples of org.jboss.cache.interceptors.base.CommandInterceptor


   public void testConcurrentRemove() throws Exception
   {
      final String slowThreadName = "SLOW";
      final String fastThreadName = "FAST";
      CommandInterceptor slowdownInterceptor = new CommandInterceptor()
      {
         @Override
         public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
         {
            if (Thread.currentThread().getName().equals(slowThreadName) && ctx.getMethodCall().getMethodId() == OptimisticPrepareCommand.METHOD_ID)
View Full Code Here


   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();

      CommandInterceptor interceptor = TestingUtil.findInterceptor(cache, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);

      mgr = cache.getTransactionManager();
   }
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();

      CommandInterceptor interceptor = TestingUtil.findInterceptor(cache, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);

      mgr = cache.getTransactionManager();
   }
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();

      CommandInterceptor interceptor = TestingUtil.findInterceptor(cache, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);

      mgr = cache.getTransactionManager();
   }
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();

      CommandInterceptor interceptor = TestingUtil.findInterceptor(cache, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);

      mgr = cache.getTransactionManager();
   }
View Full Code Here

    */
   public static void replaceInterceptorChain(CacheSPI<?, ?> cache, CommandInterceptor interceptor)
   {
      ComponentRegistry cr = extractComponentRegistry(cache);
      // make sure all interceptors here are wired.
      CommandInterceptor i = interceptor;
      do
      {
         cr.wireDependencies(i);
      }
      while ((i = i.getNext()) != null);

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

   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();
      CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
      CommandInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);
   }
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception
   {
      cache = createCache();

      CommandInterceptor interceptor = TestingUtil.findInterceptor(cache, OptimisticCreateIfNotExistsInterceptor.class);
      CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache, OptimisticNodeInterceptor.class);
      dummy = new MockInterceptor();

      interceptor.setNext(nodeInterceptor);
      nodeInterceptor.setNext(dummy);

      TestingUtil.replaceInterceptorChain(cache, interceptor);

      mgr = cache.getTransactionManager();
   }
View Full Code Here

   {
      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
      assertEquals("Expecting 6 interceptors", 6, interceptors.size());
      assertInterceptorLinkage(interceptors);

      CommandInterceptor x = new TestInterceptor();
      cache.addInterceptor(x, 0);

      interceptors = cache.getInterceptorChain();
      assertEquals("Expecting 7 interceptors", 7, interceptors.size());
      assertInterceptorLinkage(interceptors);
View Full Code Here

   {
      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
      assertEquals("Expecting 6 interceptors", 6, interceptors.size());
      assertInterceptorLinkage(interceptors);

      CommandInterceptor x = new TestInterceptor();
      cache.addInterceptor(x, 6);

      interceptors = cache.getInterceptorChain();
      assertEquals("Expecting 7 interceptors", 7, interceptors.size());
      assertInterceptorLinkage(interceptors);
View Full Code Here

TOP

Related Classes of org.jboss.cache.interceptors.base.CommandInterceptor

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.