CVS: plexus-container-new/src/java/org/apache/plexus/service/repository/instance AbstractInstanceManager.java,1.1,1.2

[email protected] Mon, 12 May 2003 13:57:30 -0500
Newsgroups gmane.comp.java.plexus.devel
Message-ID <[email protected]>
Update of /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/service/repository/instance
In directory eng.werken.com:/tmp/cvs-serv16424/src/java/org/apache/plexus/service/repository/instance

Modified Files:
	AbstractInstanceManager.java 
Log Message:
o The handling of the lifecycle is now the responsibility of the instance
  manager and not the component repository. The hierarchy may change a little on
  the inside but won't affect usage. When there was only one type of component
  instance this could be dealt with easily from the Component Repository but
  obviously when you get into dealing with different types of instantiation
  strategies the lifecycle must be handled in the entity where the strategy
  resides. I'm sure I'm just discovering what every other container writer
  has discovered along the way.
  
  I found this working on a webapp and I was playing with RunData using a
  poolabel and per-lookup instance manager and after the first lookup the
  component wasn't being run through the lifecycle. So that's been fixed.
  Now the instance manager inside the component manager is responsible
  for this and this will cause a little bit of the internals to be
  shuffled as the component repository still has the method to start
  the lifecycle which it probably doesn't need.




Index: AbstractInstanceManager.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/service/repository/instance/AbstractInstanceManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- AbstractInstanceManager.java	1 May 2003 19:35:36 -0000	1.1
+++ AbstractInstanceManager.java	12 May 2003 18:57:28 -0000	1.2
@@ -12,7 +12,8 @@
  *
  * @version $Id$
  */
-public abstract class AbstractInstanceManager
+public abstract class
+    AbstractInstanceManager
     implements InstanceManager
 {
     private ClassLoader classLoader;
@@ -91,6 +92,10 @@
         housing.setComponent( getClassLoader().loadClass( getImplementation() ).newInstance() );
         housing.setComponentManager( getComponentManager() );
 
+        getComponentManager().getComponentRespository().startComponentLifecycle( housing );
+
         return housing;
     }
+
+
 }