Package org.jboss.cache.factories

Examples of org.jboss.cache.factories.InterceptorChainFactory



   public void testBareConfig() throws Exception
   {
      cache.setUseInterceptorMbeans(false);
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testBareConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(4, list.size());
      assertEquals(list.get(0).getClass(), TxInterceptor.class);
View Full Code Here


   public void testTxConfig() throws Exception
   {
      cache.setUseInterceptorMbeans(false);
      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");

      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testTxConfig interceptors are:\n" + list);
      assertNotNull(list);
      assertEquals(4, list.size());
      assertEquals(list.get(0).getClass(), TxInterceptor.class);
View Full Code Here

      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
      cache.setCacheMode(TreeCache.REPL_ASYNC);
      cache.setFetchInMemoryState(false);
      cache.createService();
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testSharedCacheLoaderConfig interceptors are:\n" + list);
      assertNotNull(list);

      assertEquals(7, list.size());
View Full Code Here

      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, true));
      cache.setCacheMode(TreeCache.REPL_ASYNC);
      cache.setFetchInMemoryState(false);
      cache.createService();
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testUnsharedCacheLoaderConfig interceptors are:\n" + list);
      assertNotNull(list);

      assertEquals(7, list.size());
View Full Code Here

   public void testTxAndRepl() throws Exception
   {
      cache.setUseInterceptorMbeans(false);
      cache.setCacheMode("repl_sync");
      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
      List list = InterceptorChainFactory.asList(chain);
      System.out.println("testTxAndRepl interceptors are:\n" + list);
      assertNotNull(list);

      assertEquals(5, list.size());
View Full Code Here

   {
      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);

      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(6, chainAsList.size());
View Full Code Here

      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);
      cache.setCacheMode("REPL_SYNC");

      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(7, chainAsList.size());
View Full Code Here

      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(false, false));
      cache.createService();
      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(8, chainAsList.size());
View Full Code Here

      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setNodeLockingOptimistic(true);
      cache.setCacheLoaderConfiguration(getCacheLoaderConfig(true, false));
      cache.createService();
      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(next);
      Assert.assertEquals(8, chainAsList.size());
View Full Code Here

   {
      TreeCache cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setCacheMode(TreeCache.REPL_ASYNC);

      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      List chainAsList = InterceptorChainFactory.asList(chain);
      Assert.assertEquals(5, chainAsList.size());

      Assert.assertEquals(TxInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(ReplicationInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(UnlockInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(PessimisticLockInterceptor.class, chain.getClass());
      chain = chain.getNext();
      Assert.assertEquals(CallInterceptor.class, chain.getClass());

      // ok, my replication chain looks good.

      // now for my invalidation chain.
      cache = new TreeCache();
      cache.setUseInterceptorMbeans(false);
      cache.setCacheMode(TreeCache.INVALIDATION_ASYNC);
      chain = new InterceptorChainFactory().buildInterceptorChain(cache);

      // test the chain size.
      chainAsList = InterceptorChainFactory.asList(chain);
      Assert.assertEquals(5, chainAsList.size());
View Full Code Here

TOP

Related Classes of org.jboss.cache.factories.InterceptorChainFactory

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.