001    package biz.wedoit4u.ejb.entity;
002    
003    import javax.ejb.EJBException;
004    import javax.ejb.EntityBean;
005    import javax.ejb.EntityContext;
006    
007    /**
008     * A dummy implementation of the <code>EntityBean</code> interface.
009     * This class makes creating entity bean implementations easier, since
010     * no implementation is usually required for CMP beans.
011     *
012     * <p>Copyright 2003, Rakesh Vidyadharan</p>
013     *
014     * @author Rakesh Vidyadharan on 10<sup><small>th</small></sup> September 2003
015     * @version $Id: EntityBeanAdapter.java,v 1.2 2004/05/26 11:42:35 rakesh Exp $
016     */
017    public class EntityBeanAdapter implements EntityBean
018    {
019      /**
020       * Set the associated entity context. The container invokes this 
021       * method on an instance after the instance has been created.  
022       *
023       * <p>This method is called in an unspecified transaction context.</p>
024       *
025       * @param ctx - An EntityContext interface for the 
026       *   instance. The instance should store the reference to the context 
027       *   in an instance variable.
028       * @throws EJBException - Thrown by the method to indicate a failure 
029       *   caused by a system-level error.
030       */
031      public void setEntityContext( EntityContext ctx ) throws EJBException {}
032    
033      /**
034       * Unset the associated entity context. The container calls this 
035       * method before removing the instance.  
036       *
037       * <p>This is the last method that the container invokes on the 
038       * instance. The Java garbage collector will eventually invoke the 
039       * finalize() method on the instance.</p> 
040       *
041       * <p>This method is called in an unspecified transaction context.</p>
042       *
043       * @throws EJBException - Thrown by the method to indicate a failure 
044       *   caused by a system-level error.
045       */
046      public void unsetEntityContext() throws EJBException {}
047    
048      /**
049       * A container invokes this method before it removes the EJB object 
050       * that is currently associated with the instance. This method is 
051       * invoked when a client invokes a remove operation on the enterprise 
052       * Bean's home interface or the EJB object's remote interface. This 
053       * method transitions the instance from the ready state to the pool 
054       * of available instances.  
055       *
056       * <p>This method is called in the transaction context of the remove 
057       * operation.</p>
058       *
059       * @throws EJBException - Thrown by the method to indicate a failure 
060       *   caused by a system-level error.
061       */
062      public void ejbRemove() throws EJBException {}
063    
064      /**
065       * A container invokes this method when the instance is taken out of 
066       * the pool of available instances to become associated with a 
067       * specific EJB object.  This method transitions the instance to 
068       * the ready state.  
069       *
070       * <p>This method executes in an unspecified transaction context.</p>
071       *
072       * @throws EJBException - Thrown by the method to indicate a failure 
073       *   caused by a system-level error.
074       */
075      public void ejbActivate() throws EJBException {}
076    
077      /**
078       * A container invokes this method on an instance before the instance 
079       * becomes disassociated with a specific EJB object. After this 
080       * method completes, the container will place the instance into the 
081       * pool of available instances.  
082       *
083       * <p>This method executes in an unspecified transaction context.</p>
084       *
085       * @throws EJBException - Thrown by the method to indicate a failure 
086       *   caused by a system-level error.
087       */
088      public void ejbPassivate() throws EJBException {}
089    
090      /**
091       * A container invokes this method to instruct the instance to 
092       * synchronize its state by loading it state from the underlying 
093       * database.  
094       *
095       * <p>This method always executes in the transaction context 
096       * determined by the value of the transaction attribute in the 
097       * deployment descriptor.</p>
098       *
099       * @throws EJBException - Thrown by the method to indicate a failure 
100       *   caused by a system-level error.
101       */
102      public void ejbLoad() throws EJBException {}
103    
104      /**
105       * A container invokes this method to instruct the instance to 
106       * synchronize its state by storing it to the underlying database.  
107       *
108       * <p>This method always executes in the transaction context 
109       * determined by the value of the transaction attribute in the 
110       * deployment descriptor.</p>
111       *
112       * @throws EJBException - Thrown by the method to indicate a failure 
113       *   caused by a system-level error.
114       */
115      public void ejbStore() throws EJBException {}
116    }