Package org.jboss.cache.factories

Examples of org.jboss.cache.factories.ComponentRegistry


   @Override
   protected void checkLocks()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      LockManager lm = cr.getComponent(LockManager.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);

      LockAssert.assertNotLocked(A, lm, icc);
      LockAssert.assertNotLocked(Fqn.ROOT, lm, icc);
      LockAssert.assertLocked(C, lm, icc);
      LockAssert.assertLocked(A_B, lm, icc);
View Full Code Here


   @Override
   protected void checkLocksDeep()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      LockManager lm = cr.getComponent(LockManager.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);

      LockAssert.assertNotLocked(A, lm, icc);
      LockAssert.assertNotLocked(Fqn.ROOT, lm, icc);
      LockAssert.assertNotLocked(A_B_D, lm, icc);
View Full Code Here

   @Override
   protected void assertNoLocks()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      LockManager lm = cr.getComponent(LockManager.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);
      LockAssert.assertNoLocks(lm, icc);
   }
View Full Code Here

{
   protected ThreadLocal<ComponentRegistry> crTL = new ThreadLocal<ComponentRegistry>();

   protected VersionAwareMarshaller createVAMandRestartCache(String replVersion)
   {
      ComponentRegistry cr = crTL.get();
      Configuration c = cr.getComponent(Configuration.class);
      c.setReplVersionString(replVersion);
      return createVAMandRestartCache(new RegionManagerImpl());
   }
View Full Code Here

      return createVAMandRestartCache(new RegionManagerImpl());
   }

   protected VersionAwareMarshaller createVAMandRestartCache(RegionManager rm)
   {
      ComponentRegistry cr = crTL.get();
      if (cr.getState() == CacheStatus.STARTED) cr.stop();
      cr.registerComponent(rm, RegionManager.class);
      cr.create();
      cr.rewire();
      // force cache mode
      VersionAwareMarshaller m = (VersionAwareMarshaller) cr.getComponent(Marshaller.class);
      m.init();
      m.initReplicationVersions();
      return m;
   }
View Full Code Here

public class VersionAwareMarshallerTest extends AbstractVersionAwareMarshallerTest
{
   @BeforeMethod
   public void setUp()
   {
      ComponentRegistry cr = new ComponentRegistry(new Configuration(), new CacheInvocationDelegate());
      crTL.set(cr);
   }
View Full Code Here

   @AfterMethod
   public void postTest()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);

      LockAssert.assertNoLocks(cr.getComponent(LockManager.class), cr.getComponent(InvocationContextContainer.class));
   }
View Full Code Here

   @AfterMethod
   public void postTest()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);

      LockAssert.assertNoLocks(cr.getComponent(LockManager.class), cr.getComponent(InvocationContextContainer.class));
   }
View Full Code Here

   @Override
   protected void assertLocked(Fqn fqn, CacheSPI cache, boolean writeLocked)
   {
      if (!writeLocked) return; // MVCC only does write locks.
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      LockAssert.assertLocked(fqn, cr.getComponent(LockManager.class), cr.getComponent(InvocationContextContainer.class));
   }
View Full Code Here

      RPCManager rpcManager = EasyMock.createNiceMock(RPCManager.class);
      RPCManager originalRpcManager = tl.cache1.getConfiguration().getRuntimeConfig().getRPCManager();
      List<Address> memberList = originalRpcManager.getMembers();
      expect(rpcManager.getMembers()).andReturn(memberList).anyTimes();
      // inject a mock RPC manager so that we can test whether calls made are sync or async.
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(tl.cache1);
      cr.registerComponent(rpcManager, RPCManager.class);
      cr.rewire();

      // invalidations will not trigger any rpc calls for PFER
      if (!isUsingInvalidation())
      {
         // specify what we expect called on the mock Rpc Manager.  For params we don't care about, just use ANYTHING.
View Full Code Here

TOP

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

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.