Package org.jboss.cache.invocation

Examples of org.jboss.cache.invocation.InvocationContextContainer


      assert !lock.isLocked();
   }

   public void testGtxLockedByGtxSuccess() throws InterruptedException
   {
      final InvocationContextContainer icc = getInvocationContextContainer();
      final OwnableReentrantLock lock = new OwnableReentrantLock(icc);
      final AtomicBoolean acquired = new AtomicBoolean(false);
      GlobalTransaction gtx = new GlobalTransaction();
      gtx.setId(10);
      icc.get().setGlobalTransaction(gtx);

      lock.lock();
      assert lock.getOwner().equals(gtx);
      assert lock.getHoldCount() == 1;

      Thread t = new Thread()
      {
         public void run()
         {
            try
            {
               GlobalTransaction gtx = new GlobalTransaction();
               gtx.setId(10);
               icc.get().setGlobalTransaction(gtx);
               acquired.set(lock.tryLock(10, TimeUnit.MILLISECONDS));
            }
            catch (InterruptedException e)
            {
               // do nothing
View Full Code Here


      assert !lock.isLocked();
   }

   public void satisfyCodeCoverage() throws InterruptedException
   {
      final InvocationContextContainer icc = getInvocationContextContainer();
      final OwnableReentrantLock lock = new OwnableReentrantLock(icc);
      System.out.println(lock.toString());
      lock.lockInterruptibly();
      System.out.println(lock.toString());
View Full Code Here

      assert !lock.isHeldExclusively();
   }

   public void testSerialization() throws IOException, ClassNotFoundException
   {
      final InvocationContextContainer icc = getInvocationContextContainer();
      final OwnableReentrantLock lock = new OwnableReentrantLock(icc);
      lock.lock();
      assert lock.isLocked();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

   InvocationContextContainer icc;

   @BeforeMethod
   public void setUp()
   {
      icc = new InvocationContextContainer();
      icc.injectContextFactory(new MVCCContextFactory());
      lm = new MVCCLockManager();
      TransactionManager tm = getTransactionManager();
      lm.injectConfiguration(new Configuration());
      lm.injectDependencies(null, null, tm, icc);
View Full Code Here

   @BeforeMethod
   public void setUp()
   {
      AbstractLockManagerRecordingTestTL tl = new AbstractLockManagerRecordingTestTL();
      threadLocal.set(tl);     
      tl.icc = new InvocationContextContainer();
      tl.lm = new NodeBasedLockManager();
      PessimisticContextFactory pcf = new PessimisticContextFactory();
      tl.icc.injectContextFactory(pcf);
      tl.contextFactory = pcf;
      fqnBasedLocking = false;
View Full Code Here

   @BeforeMethod
   public void setUp()
   {
      AbstractLockManagerRecordingTestTL tl = new AbstractLockManagerRecordingTestTL();
      threadLocal.set(tl);
      tl.icc = new InvocationContextContainer();
      MVCCLockManager mvccLockManager = new MVCCLockManager();
      TransactionManager tm = DummyTransactionManager.getInstance();
      mvccLockManager.injectConfiguration(new Configuration());
      mvccLockManager.injectDependencies(null, null, tm, tl.icc);
      mvccLockManager.startLockManager();
View Full Code Here

   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

   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

   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

   @BeforeMethod
   public void setUp()
   {
      AbstractLockManagerRecordingTestTL tl = new AbstractLockManagerRecordingTestTL();
      threadLocal.set(tl);     
      tl.icc = new InvocationContextContainer();
      tl.lm = new NodeBasedLockManager();
      PessimisticContextFactory pcf = new PessimisticContextFactory();
      tl.icc.injectContextFactory(pcf);
      tl.contextFactory = pcf;
      fqnBasedLocking = false;
View Full Code Here

TOP

Related Classes of org.jboss.cache.invocation.InvocationContextContainer

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.