Package org.jboss.ejb

Examples of org.jboss.ejb.BeanLock


/*     */     {
/* 210 */       ctx.setValid(true);
/*     */
/* 212 */       if (tx != null)
/*     */       {
/* 214 */         BeanLock lock = this.container.getLockManager().getLock(ctx.getCacheKey());
/*     */         try
/*     */         {
/* 217 */           lock.schedule(mi);
/* 218 */           register(ctx, tx);
/* 219 */           lock.endInvocation(mi);
/*     */         }
/*     */         finally
/*     */         {
/* 223 */           this.container.getLockManager().removeLockRef(lock.getId());
/*     */         }
/*     */       }
/*     */     }
/* 227 */     return rtn; }
View Full Code Here


/*     */     {
/* 137 */       obj = getNext().invokeHome(mi);
/*     */
/* 140 */       if (ctx.getId() != null)
/*     */       {
/* 142 */         BeanLock lock = container.getLockManager().getLock(ctx.getCacheKey());
/* 143 */         lock.sync();
/*     */         try
/*     */         {
/* 149 */           cache = container.getInstanceCache();
/* 150 */           cache.remove(ctx.getCacheKey());
/*     */
/* 154 */           cache.insert(ctx);
/*     */         }
/*     */         finally
/*     */         {
/* 158 */           lock.releaseSync();
/* 159 */           container.getLockManager().removeLockRef(ctx.getCacheKey());
/*     */         }
/*     */
/* 163 */         InstanceCache cache = obj;
/*     */         return cache;
View Full Code Here

/*     */
/*     */   protected void tryToPassivate(EnterpriseContext ctx, boolean passivateAfterCommit)
/*     */   {
/* 173 */     Object id = ctx.getId();
/* 174 */     if (id == null) return;
/* 175 */     BeanLock lock = getContainer().getLockManager().getLock(id);
/* 176 */     boolean lockedBean = false;
/*     */     try
/*     */     {
/* 187 */       if ((lock instanceof BeanLockExt))
/*     */       {
/* 189 */         BeanLockExt lock2 = (BeanLockExt)lock;
/* 190 */         lockedBean = lock2.attemptSync();
/* 191 */         if (!lockedBean)
/*     */         {
/* 193 */           unableToPassivateDueToCtxLock(ctx, passivateAfterCommit);
/*     */           return;
/*     */         }
/*     */       }
/*     */       else {
/* 200 */         lock.sync();
/* 201 */         lockedBean = true;
/*     */       }
/*     */
/* 204 */       if (canPassivate(ctx))
/*     */       {
/*     */         try
/*     */         {
/* 208 */           remove(id);
/* 209 */           passivate(ctx);
/* 210 */           freeContext(ctx);
/*     */         }
/*     */         catch (Exception ignored)
/*     */         {
/* 214 */           log.warn("failed to passivate, id=" + id, ignored);
/*     */         }
/*     */
/*     */       }
/*     */       else
/*     */       {
/* 220 */         synchronized (getCacheLock())
/*     */         {
/* 222 */           getCache().get(id);
/*     */         }
/*     */
/* 225 */         unableToPassivateDueToCtxLock(ctx, passivateAfterCommit);
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/* 230 */       if (lockedBean)
/* 231 */         lock.releaseSync();
/* 232 */       getContainer().getLockManager().removeLockRef(id);
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.BeanLock

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.