User: dsundstrom
  Date: 01/06/23 20:06:45

  Modified:    src/main/org/jboss/ejb Container.java EntityContainer.java
                        EntityPersistenceManager.java
  Log:
  Updated containers, persistence managers and pools to deligate the task of
  creating the bean instance and initializing the bean to the persistence
  store.  The code detects checks to see if the store is an
  EntityPersistenceStore2 and if it is, the persistence manager deligates.
  In the event that the store is 'old style' default old implementation is
  invoked.
  
  Revision  Changes    Path
  1.46      +15 -1     jboss/src/main/org/jboss/ejb/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Container.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Container.java    2001/06/18 20:01:21     1.45
  +++ Container.java    2001/06/24 03:06:45     1.46
  @@ -73,7 +73,7 @@
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Rickard Öberg</a>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
  - *   @version $Revision: 1.45 $
  + *   @version $Revision: 1.46 $
    */
   public abstract class Container
   {
  @@ -302,6 +302,20 @@
      {
         return beanClass;
      }
  +
  +     /**
  +     * Returns a new instance of the bean class or a subclass of the bean class.
  +     * This factory style method is speciffically used by a container to supply
  +   * an implementation of the abstract accessors in EJB2.0, but could be usefull
  +     * in other situations. This method should ALWAYS be used instead of 
  +     * getBeanClass().newInstance();
  +     * 
  +     * @see java.lang.Class#newInstance 
  +     * @return the new instance
  +     */
  +     public Object createBeanClassInstance() throws Exception {
  +             return getBeanClass().newInstance();
  +     }
   
      /**
      * The ContainerFactory calls this method.  The ContainerFactory has set all the
  
  
  
  1.43      +14 -1     jboss/src/main/org/jboss/ejb/EntityContainer.java
  
  Index: EntityContainer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- EntityContainer.java      2001/06/18 20:01:21     1.42
  +++ EntityContainer.java      2001/06/24 03:06:45     1.43
  @@ -40,7 +40,7 @@
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Daniel OConnor</a>
   *   @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
  -*   @version $Revision: 1.42 $
  +*   @version $Revision: 1.43 $
   */
   public class EntityContainer
   extends Container
  @@ -184,6 +184,19 @@
         return remoteInterface;
      }
    
  +     /**
  +     * Returns a new instance of the bean class or a subclass of the bean class.
  +     * If this is 1.x cmp, simply return a new instance of the bean class.
  +     * If this is 2.x cmp, return a subclass that provides an implementation
  +     * of the abstract accessors.
  +     * 
  +     * @see java.lang.Class#newInstance 
  +     * @return the new instance
  +     */
  +     public Object createBeanClassInstance() throws Exception {
  +             return persistenceManager.createBeanClassInstance();
  +     }
  +
      // Container implementation --------------------------------------
      public void init()
      throws Exception
  
  
  
  1.7       +8 -1      jboss/src/main/org/jboss/ejb/EntityPersistenceManager.java
  
  Index: EntityPersistenceManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityPersistenceManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EntityPersistenceManager.java     2001/06/18 20:01:21     1.6
  +++ EntityPersistenceManager.java     2001/06/24 03:06:45     1.7
  @@ -26,12 +26,19 @@
    *
    *   @see EntityContainer
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Rickard Öberg</a>
  - *   @version $Revision: 1.6 $
  + *   @version $Revision: 1.7 $
    */
   public interface EntityPersistenceManager
      extends ContainerPlugin
   {
      // Public --------------------------------------------------------
  +
  +     /**
  +     * Returns a new instance of the bean class or a subclass of the bean class.
  +     * 
  +     * @return the new instance
  +     */
  +     public Object createBeanClassInstance() throws Exception;
   
        /**
         *      This method is called whenever an entity is to be created. The 
persistence manager
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to