Package org.jboss.ejb

Examples of org.jboss.ejb.EnterpriseContext$UserTransactionImpl


/*  70 */     return this.container;
/*     */   }
/*     */
/*     */   public Object invoke(Invocation mi) throws Exception
/*     */   {
/*  75 */     EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext();
/*  76 */     if (ctx == null) {
/*  77 */       throw new IllegalStateException("EJBContext is null");
/*     */     }
/*  79 */     ctx.setSecurityContext(mi.getSecurityContext());
/*     */
/*  82 */     ctx.setPrincipal(mi.getPrincipal());
/*     */     Object localObject1;
/*     */     try {
/*  87 */       localObject1 = getNext().invoke(mi);
/*     */     }
/*     */     finally
View Full Code Here


/*  96 */     Method getEJBObject = Handle.class.getMethod("getEJBObject", new Class[0]);
/*     */
/*  99 */     if (getEJBObject.equals(mi.getMethod())) {
/* 100 */       return getNext().invokeHome(mi);
/*     */     }
/* 102 */     EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext();
/* 103 */     if (ctx == null) {
/* 104 */       throw new IllegalStateException("EJBContext is null");
/* 106 */     }ctx.setSecurityContext(mi.getSecurityContext());
/*     */
/* 108 */     ctx.setPrincipal(mi.getPrincipal());
/*     */     Object localObject1;
/*     */     try {
/* 113 */       localObject1 = getNext().invokeHome(mi);
/*     */     }
/*     */     finally
View Full Code Here

/*     */   {
/* 108 */     if (key == null)
/*     */     {
/* 110 */       throw new IllegalArgumentException("Requesting an object using a null key");
/*     */     }
/* 112 */     EnterpriseContext ctx = null;
/* 113 */     synchronized (this.m_map)
/*     */     {
/* 115 */       ctx = (EnterpriseContext)this.m_map.get(key);
/*     */     }
/* 117 */     return ctx;
View Full Code Here

/* 124 */     if (getEJBObject.equals(mi.getMethod())) {
/* 125 */       return getNext().invokeHome(mi);
/*     */     }
/*     */
/* 128 */     InstancePool pool = this.container.getInstancePool();
/* 129 */     EnterpriseContext ctx = pool.get();
/*     */
/* 132 */     mi.setEnterpriseContext(ctx);
/*     */
/* 135 */     ctx.lock();
/*     */
/* 142 */     AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_HOME);
/*     */     try
/*     */     {
/* 147 */       localObject1 = getNext().invokeHome(mi);
/*     */     }
/*     */     finally
/*     */     {
/* 151 */       synchronized (ctx)
/*     */       {
/*     */         Object localObject1;
/* 153 */         AllowedOperationsAssociation.popInMethodFlag();
/*     */
/* 156 */         ctx.unlock();
/*     */
/* 159 */         if (ctx.getId() == null)
/*     */         {
/* 161 */           pool.free(ctx);
/*     */         }
/*     */       }
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   public Object invokeHome(Invocation mi)
/*     */     throws Exception
/*     */   {
/* 178 */     EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext();
/* 179 */     if (ctx == null) {
/* 180 */       return getNext().invokeHome(mi);
/*     */     }
/*     */
/* 183 */     Object key = ctx.getInstance();
/*     */     try
/*     */     {
/* 186 */       this.ccm.pushMetaAwareObject(key, this.unsharableResources);
/*     */       try
/*     */       {
View Full Code Here

/* 137 */     Object oldUserTx = this.userTransaction.get();
/*     */
/* 141 */     Transaction threadTx = this.tm.suspend();
/*     */     try
/*     */     {
/* 145 */       EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext();
/*     */       try
/*     */       {
/* 150 */         AllowedOperationsAssociation.pushInMethodFlag(IN_INTERCEPTOR_METHOD);
/* 151 */         this.userTransaction.set(ctx.getEJBContext().getUserTransaction());
/*     */       }
/*     */       finally
/*     */       {
/* 155 */         AllowedOperationsAssociation.popInMethodFlag();
/*     */       }
/*     */
/* 159 */       Transaction beanTx = ctx.getTransaction();
/*     */
/* 163 */       if (beanTx != null) {
/* 164 */         this.tm.resume(beanTx);
/*     */       }
/*     */
View Full Code Here

/*     */   }
/*     */
/*     */   public EnterpriseContext get(Object id)
/*     */     throws RemoteException, NoSuchObjectException
/*     */   {
/*  76 */     EnterpriseContext rtn = null;
/*  77 */     rtn = super.get(id);
/*  78 */     return rtn;
/*     */   }
View Full Code Here

/*     */   public Object invoke(Invocation mi)
/*     */     throws Exception
/*     */   {
/*  81 */     MessageDrivenContainer mdc = (MessageDrivenContainer)this.container;
/*  82 */     InstancePool pool = mdc.getInstancePool();
/*  83 */     EnterpriseContext ctx = null;
/*     */     try
/*     */     {
/*  86 */       ctx = pool.get();
/*     */     }
/*     */     catch (EJBException e)
/*     */     {
/*  90 */       throw e;
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/*  94 */       throw new EJBException("Unable to get an instance from the pool", e);
/*     */     }
/*     */
/*  98 */     ctx.setPrincipal(mi.getPrincipal());
/*     */
/* 101 */     mi.setEnterpriseContext(ctx);
/*     */
/* 103 */     EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());
/*     */
/* 105 */     if (ejbTimeout.equals(mi.getMethod()))
/* 106 */       AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_TIMEOUT);
/*     */     else {
/* 108 */       AllowedOperationsAssociation.pushInMethodFlag(IN_BUSINESS_METHOD);
View Full Code Here

/*     */   {
/* 156 */     if (key != null)
/*     */     {
/* 158 */       synchronized (getCacheLock())
/*     */       {
/* 160 */         EnterpriseContext ctx = (EnterpriseContext)getCache().peek(key);
/* 161 */         if (ctx != null)
/*     */         {
/* 163 */           release(ctx);
/*     */         }
/*     */       }
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 144 */     if (this.securityProxy != null)
/*     */     {
/* 146 */       EJBContext ctx = null;
/* 147 */       EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext();
/* 148 */       if (ectx != null)
/* 149 */         ctx = ectx.getEJBContext();
/* 150 */       Object[] args = mi.getArguments();
/* 151 */       this.securityProxy.setEJBContext(ctx);
/*     */       try
/*     */       {
/* 154 */         this.securityProxy.invokeHome(mi.getMethod(), args);
View Full Code Here

TOP

Related Classes of org.jboss.ejb.EnterpriseContext$UserTransactionImpl

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.