User: fleury  
  Date: 00/08/24 18:52:26

  Modified:    src/main/org/jboss/ejb EntityEnterpriseContext.java
  Log:
  Don't expose a FastKey the cache is responsible for everything
  
  Revision  Changes    Path
  1.8       +15 -19    jboss/src/main/org/jboss/ejb/EntityEnterpriseContext.java
  
  Index: EntityEnterpriseContext.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/EntityEnterpriseContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EntityEnterpriseContext.java      2000/08/18 03:20:53     1.7
  +++ EntityEnterpriseContext.java      2000/08/25 01:52:26     1.8
  @@ -14,7 +14,6 @@
   import javax.ejb.EntityContext;
   
   import javax.transaction.Transaction;
  -import org.jboss.util.FastKey;
   
   /**
   *    The EntityEnterpriseContext is used to associate EntityBean instances with 
metadata about it.
  @@ -22,7 +21,7 @@
   *    @see EnterpriseContext
   *    @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  -*    @version $Revision: 1.7 $
  +*    @version $Revision: 1.8 $
   */
   public class EntityEnterpriseContext
   extends EnterpriseContext
  @@ -44,13 +43,10 @@
       
       // The persistence manager may attach any metadata it wishes to this context 
here
       Object persistenceCtx;
  +     
  +     //The cacheKey for this context
  +     CacheKey key;
       
  -    // This is ONLY used at construction time.  The association from FastKey to EEC
  -    // Is a many to one.  the one held here uses the EEC as a "vehicle" nothing more
  -    // It usually corresponds to the FastKey of the EJBObject that build it.
  -    // It is pretty and we keep the API of the cache.
  -    public FastKey fastKey;
  -    
       // Constructors --------------------------------------------------
       public EntityEnterpriseContext(Object instance, Container con)
       throws RemoteException
  @@ -78,6 +74,13 @@
          return ejbObject; 
       }
       
  +     public void setCacheKey(Object key) {
  +             this.key = (CacheKey) key;
  +     }
  +     
  +     public CacheKey getCacheKey() {
  +             return key;
  +     }
       
       public void setPersistenceContext(Object ctx) 
       { 
  @@ -121,17 +124,7 @@
          return valid; 
       }
       
  -    public void setFastKey(FastKey fastKey) {
  -    
  -        this.fastKey = fastKey;   
  -    }
  -    
  -    public FastKey getFastKey() {
  -        
  -        return fastKey;   
  -    }
       
  -    
       // Inner classes -------------------------------------------------
       protected class EntityContextImpl
       extends EJBContextImpl
  @@ -143,7 +136,10 @@
            
             try {
                 
  -              ejbObject = 
((EntityContainer)con).getContainerInvoker().getEntityEJBObject(new FastKey(id)); 
  +                       // Create a new CacheKey
  +                       Object cacheKey = ((EntityInstanceCache) ((EntityContainer) 
con).getInstanceCache()).createCacheKey( id );
  +        
  +                       ejbObject = 
((EntityContainer)con).getContainerInvoker().getEntityEJBObject(cacheKey); 
             }
                 catch (RemoteException re) {
                 // ...
  
  
  

Reply via email to