User: fleury  
  Date: 00/07/27 16:06:55

  Modified:    src/main/org/jboss/ejb EntityEnterpriseContext.java
                        EnterpriseContext.java
  Log:
  All Enterprise Bean have a notion of Tx and principal.  Previously the Session beans 
had no notion of Transaction.  Factoring it fixes it.
  
  Revision  Changes    Path
  1.3       +3 -14     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EntityEnterpriseContext.java      2000/05/30 18:32:16     1.2
  +++ EntityEnterpriseContext.java      2000/07/27 23:06:55     1.3
  @@ -20,7 +20,8 @@
    *      
    *   @see EnterpriseContext
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.2 $
  + *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  + *   @version $Revision: 1.3 $
    */
   public class EntityEnterpriseContext
      extends EnterpriseContext
  @@ -35,9 +36,6 @@
        // True if this instances' state is synchronized with the DB
      boolean synched = false;
      
  -   // Set to the tx currently using this context. May be null
  -   Transaction tx;
  -     
        // The instance cache may attach any metadata it wishes to this context here
      Object cacheCtx;
        
  @@ -69,16 +67,7 @@
                return ejbObject; 
        }
      
  -   public void setTransaction(Transaction tx) 
  -     { 
  -             this.tx = tx; 
  -     }
  -     
  -   public Transaction getTransaction() 
  -     { 
  -             return tx; 
  -     }
  -     
  + 
      public void setPersistenceContext(Object ctx) 
        { 
                this.persistenceCtx = ctx; 
  
  
  
  1.3       +24 -6     jboss/src/main/org/jboss/ejb/EnterpriseContext.java
  
  Index: EnterpriseContext.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/EnterpriseContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EnterpriseContext.java    2000/05/30 18:32:16     1.2
  +++ EnterpriseContext.java    2000/07/27 23:06:55     1.3
  @@ -33,7 +33,8 @@
    *   @see StatelessSessionEnterpriseContext
    *   @see EntityEnterpriseContext
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.2 $
  + *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  + *   @version $Revision: 1.3 $
    */
   public abstract class EnterpriseContext
   {
  @@ -48,6 +49,12 @@
        
        // Set to the synchronization currently associated with this context. May be 
null
      Synchronization synch;
  +   
  +   // The transaction associated with the call
  +   Transaction transaction;
  +   
  +   // The principal associated with the call
  +   Principal principal;
        
      Object id; // Not used for sessions
      // Static --------------------------------------------------------
  @@ -68,16 +75,27 @@
      public abstract void discard()
         throws RemoteException;
         
  -   public void setId(Object id) 
  -     { 
  +   public void setId(Object id) { 
                this.id = id; 
        }
        
  -   public Object getId() 
  -     { 
  +   public Object getId() { 
                return id; 
        }
   
  +   public void setTransaction(Transaction transaction) { 
  +             this.transaction = transaction; 
  +     }
  +     
  +   public Transaction getTransaction() { 
  +             return transaction; 
  +     }
  +     
  +     public void setPrincipal(Principal principal) {
  +             
  +             this.principal = principal;
  +     }
  +     
      // Package protected ---------------------------------------------
       
      // Protected -----------------------------------------------------
  @@ -100,7 +118,7 @@
         
         public Principal getCallerPrincipal() 
                { 
  -                     throw new Error("Not yet implemented");
  +                     return principal;
                }
         
         public EJBHome getEJBHome() 
  
  
  

Reply via email to