Update of /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/lifecycle/avalon
In directory eng.werken.com:/tmp/cvs-serv18970
Modified Files:
AvalonLifecycleHandler.java
Log Message:
o The lifecyle handler factory along with the configuration takes care
of everything now. The only thing that needs to be done now is the
adaptation of the plexus service repo to an avalon service manager.
Index: AvalonLifecycleHandler.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/lifecycle/avalon/AvalonLifecycleHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- AvalonLifecycleHandler.java 25 Apr 2003 17:42:36 -0000 1.6
+++ AvalonLifecycleHandler.java 25 Apr 2003 19:23:29 -0000 1.7
@@ -58,27 +58,11 @@
import org.apache.plexus.lifecycle.AbstractLifecycleHandler;
import org.apache.plexus.lifecycle.LifecycleHandler;
-import org.apache.plexus.lifecycle.phase.ConfigurePhase;
-import org.apache.plexus.lifecycle.phase.ContextualizePhase;
-import org.apache.plexus.lifecycle.phase.DisposePhase;
-import org.apache.plexus.lifecycle.phase.InitializePhase;
-import org.apache.plexus.lifecycle.phase.LogEnablePhase;
-import org.apache.plexus.lifecycle.phase.ParameterizePhase;
import org.apache.plexus.lifecycle.phase.Phase;
-import org.apache.plexus.lifecycle.phase.ReconfigurePhase;
-import org.apache.plexus.lifecycle.phase.RecontextualizePhase;
-import org.apache.plexus.lifecycle.phase.ReparameterizePhase;
-import org.apache.plexus.lifecycle.phase.ResumePhase;
-import org.apache.plexus.lifecycle.phase.ServicePhase;
-import org.apache.plexus.lifecycle.phase.StartPhase;
-import org.apache.plexus.lifecycle.phase.StopPhase;
-import org.apache.plexus.lifecycle.phase.SuspendPhase;
import org.apache.plexus.service.repository.ServiceCapsule;
import org.apache.plexus.service.repository.ServiceRepository;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
/** An Avalon service lifecycle handler.
*
@@ -102,17 +86,13 @@
/** */
public static String SERVICE_MANAGER = "service.manager";
- List beginSegment;
- List suspendSegment;
- List resumeSegment;
- List endSegment;
-
// ----------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------
public AvalonLifecycleHandler()
{
+ super();
}
public void initialize()
@@ -120,70 +100,5 @@
{
addEntity( SERVICE_MANAGER, new AvalonServiceManager(
(ServiceRepository) getEntities().get( LifecycleHandler.SERVICE_REPOSITORY ) ) );
- }
-
- public void assembleSegments()
- throws Exception
- {
- // I'm sure we could make this more configurable. A little properties file in the
- // same package would probably do and be good for j2me environments. We'll avoid
- // XML where we can.
-
- beginSegment = new ArrayList();
- suspendSegment = new ArrayList();
- resumeSegment = new ArrayList();
- endSegment = new ArrayList();
-
- beginSegment.add( new LogEnablePhase() );
- beginSegment.add( new ContextualizePhase() );
- beginSegment.add( new ServicePhase() );
- beginSegment.add( new ConfigurePhase() );
- beginSegment.add( new ParameterizePhase() );
- beginSegment.add( new InitializePhase() );
- beginSegment.add( new StartPhase() );
-
- suspendSegment.add( new SuspendPhase() );
- suspendSegment.add( new RecontextualizePhase() );
- suspendSegment.add( new ReconfigurePhase() );
- suspendSegment.add( new ReparameterizePhase() );
-
- resumeSegment.add( new ResumePhase() );
-
- endSegment.add( new StopPhase() );
- endSegment.add( new DisposePhase() );
- }
-
- /** Start a component's lifecycle.
- *
- * @param service The component service.
- *
- * @throws java.lang.Exception If an error occurs while attempting to beginSegment
- * the component's lifecycle.
- */
- public void startLifecycle( ServiceCapsule service )
- throws Exception
- {
- for ( Iterator i = beginSegment.iterator(); i.hasNext(); )
- {
- Phase phase = (Phase) i.next();
- phase.execute( service, this );
- }
- }
-
- /** End a component's lifecycle.
- *
- * @param service The component service.
- *
- * @throws java.lang.Exception If an error occurs while attempting to endSegment
- * the component's lifecycle.
- */
- public void endLifecycle( ServiceCapsule service )
- throws Exception
- {
- for ( Iterator i = endSegment.iterator(); i.hasNext(); )
- {
- Phase phase = (Phase) i.next();
- phase.execute( service, this );
- }
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.