User: fleury  
  Date: 00/08/24 18:51:16

  Modified:    src/main/org/jboss/ejb EntityContainer.java
  Log:
  Do not expose cache keys.  Traces for debug
  
  Revision  Changes    Path
  1.24      +32 -19    jboss/src/main/org/jboss/ejb/EntityContainer.java
  
  Index: EntityContainer.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- EntityContainer.java      2000/08/18 03:20:53     1.23
  +++ EntityContainer.java      2000/08/25 01:51:16     1.24
  @@ -25,7 +25,6 @@
   import javax.ejb.RemoveException;
   
   import org.jboss.logging.Logger;
  -import org.jboss.util.FastKey;
   import org.jboss.util.SerializableEnumeration;
   
   /**
  @@ -36,7 +35,7 @@
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
  -*   @version $Revision: 1.23 $
  +*   @version $Revision: 1.24 $
   */
   public class EntityContainer
   extends Container
  @@ -306,14 +305,24 @@
       public Object invokeHome(MethodInvocation mi)
       throws Exception
       {
  -        return getInterceptor().invokeHome(mi);
  +        
  +             Logger.log("invokeHome");
  +             try { return getInterceptor().invokeHome(mi); }
  +             catch (Exception e) {e.printStackTrace(); throw e;}
  +             
  +     //      return getInterceptor().invokeHome(mi);
  +             
       }
       
       public Object invoke(MethodInvocation mi)
       throws Exception
       {
  +             try { return getInterceptor().invoke(mi); }
  +             catch (Exception e) {e.printStackTrace();throw e;}
  +             
  +             
           // Invoke through interceptors
  -        return getInterceptor().invoke(mi);
  +     //   return getInterceptor().invoke(mi);
       }
       
       // EJBObject implementation --------------------------------------
  @@ -377,7 +386,9 @@
           {
               // Iterator finder
               Collection c = getPersistenceManager().findEntities(mi.getMethod(), 
mi.getArguments(), (EntityEnterpriseContext)mi.getEnterpriseContext());
  -            Collection ec = containerInvoker.getEntityCollection(c);
  +            
  +                     // Get the EJBObjects with that
  +                     Collection ec = containerInvoker.getEntityCollection(c);
               
               // BMP entity finder methods are allowed to return 
java.util.Enumeration.
               // We need a serializable Enumeration, so we can't use 
Collections.enumeration()
  @@ -397,11 +408,11 @@
               
               // Single entity finder
               Object id = getPersistenceManager().findEntity(mi.getMethod(), 
  -                mi.getArguments(), 
  -                (EntityEnterpriseContext)mi.getEnterpriseContext());    
  +                     mi.getArguments(), 
  +                     (EntityEnterpriseContext)mi.getEnterpriseContext());    
               
               //create the EJBObject
  -            return (EJBObject)containerInvoker.getEntityEJBObject(new FastKey(id));
  +            return (EJBObject)containerInvoker.getEntityEJBObject(id);
           }
       }
       
  @@ -412,17 +423,19 @@
       * It delegates to the persistence manager.
       *
       */
  -    
  -    public EJBObject createHome(MethodInvocation mi)
  -    throws java.rmi.RemoteException, CreateException
  -    {
  -        
  -        getPersistenceManager().createEntity(mi.getMethod(), 
  -            mi.getArguments(), 
  -            (EntityEnterpriseContext) mi.getEnterpriseContext());
  -        return ((EntityEnterpriseContext)mi.getEnterpriseContext()).getEJBObject();
  -    }
       
  +     public EJBObject createHome(MethodInvocation mi)
  +     throws java.rmi.RemoteException, CreateException
  +     {
  +             
  +             // The persistence manager takes care of the wiring and creating the 
EJBObject
  +             getPersistenceManager().createEntity(mi.getMethod(),mi.getArguments(), 
  +                     (EntityEnterpriseContext) mi.getEnterpriseContext());
  +                     
  +             // The context implicitely carries the EJBObject 
  +             return 
((EntityEnterpriseContext)mi.getEnterpriseContext()).getEJBObject();
  +     }
  +     
       /**
       * A method for the getEJBObject from the handle
       * 
  @@ -431,7 +444,7 @@
       throws java.rmi.RemoteException  {
           
           // All we need is an EJBObject for this Id;
  -        return (EJBObject)containerInvoker.getEntityEJBObject(new 
FastKey(mi.getId()));        
  +        return 
(EJBObject)containerInvoker.getEntityEJBObject(((EntityInstanceCache) 
instanceCache).createCacheKey(mi.getId()));        
       }
       
       
  
  
  

Reply via email to