Package org.jboss.ejb

Examples of org.jboss.ejb.EnterpriseContext


/*     */   public Object invoke(Invocation mi)
/*     */     throws Exception
/*     */   {
/* 170 */     if (this.securityProxy != null)
/*     */     {
/* 172 */       EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext();
/* 173 */       Object bean = ectx.getInstance();
/* 174 */       EJBContext ctx = ectx.getEJBContext();
/* 175 */       Object[] args = mi.getArguments();
/* 176 */       this.securityProxy.setEJBContext(ctx);
/*     */       try
/*     */       {
/* 179 */         this.securityProxy.invoke(mi.getMethod(), args, bean);
View Full Code Here


/*     */   private void freeAll()
/*     */   {
/* 347 */     LinkedList clone = (LinkedList)this.pool.clone();
/* 348 */     for (int i = 0; i < clone.size(); i++)
/*     */     {
/* 350 */       EnterpriseContext ec = (EnterpriseContext)clone.get(i);
/*     */
/* 352 */       ec.clear();
/* 353 */       discard(ec);
/*     */     }
/* 355 */     this.pool.clear();
/*     */   }
View Full Code Here

/*     */
/*     */   public EnterpriseContext get(Object id)
/*     */     throws RemoteException, NoSuchObjectException
/*     */   {
/* 109 */     if (id == null) throw new IllegalArgumentException("Can't get an object with a null key");
/*     */     EnterpriseContext ctx;
/* 113 */     synchronized (getCacheLock())
/*     */     {
/* 115 */       CachePolicy cache = getCache();
/* 116 */       ctx = (EnterpriseContext)cache.get(id);
/* 117 */       if (ctx == null)
View Full Code Here

   }
  
   public Object invokeHome (Invocation mi)
      throws Exception
   {
      EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext ();
     
      try
      {
         // Invoke through interceptors
         return getNext ().invokeHome (mi);
      }
      finally
      {
         if ( (ctx != null) && (ctx.getId () != null) )
            // Still a valid instance and instance not removed
            //
         {
            // Everything went ok (at least no J2EE problem) and the instance will most probably be called
            // many more times. Consequently, we need to synchronize the state of our bean instance with
View Full Code Here

   }
  
   public Object invoke (Invocation mi)
      throws Exception
   {
      EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext ();
     
      try
      {
         // Invoke through interceptors
         return getNext ().invoke (mi);
      }
      catch (RemoteException e)
      {
         ctx = null;
         throw e;
      }
      catch (RuntimeException e)
      {
         ctx = null;
         throw e;
      }
      catch (Error e)
      {
         ctx = null;
         throw e;
      }
      finally
      {
         if ( (ctx != null) && (ctx.getId () != null) )
            // Still a valid instance and instance not removed
            //
         {
            // Everything went ok (at least no J2EE problem) and the instance will most probably be called
            // many more times. Consequently, we need to synchronize the state of our bean instance with
            // our persistant store (which will forward this to its HASessionState implementation) for clustering
            // behaviour.
            //
           
            if(isModified == null)
            {
               synchronizeState (ctx);
            }
            else
            {
               Boolean modified = (Boolean) isModified.invoke (ctx.getInstance (), new Object[0]);
               if (modified.booleanValue ())
                  synchronizeState (ctx);
            }
         }
      }
View Full Code Here

   public EnterpriseContext get(Object id)
      throws RemoteException, NoSuchObjectException
   {
      if (id == null) throw new IllegalArgumentException("Can't get an object with a null key");

      EnterpriseContext ctx = null;

      synchronized (getCacheLock())
      {
         ctx = (EnterpriseContext)getCache().get(id);
         if (ctx != null)
View Full Code Here

TOP

Related Classes of org.jboss.ejb.EnterpriseContext

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.