avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin DefaultController.java
Date Thu, 08 Aug 2002 21:29:24 GMT
mcconnell    2002/08/08 14:29:24

  Modified:    assembly/src/java/org/apache/excalibur/merlin
                        DefaultController.java
  Log:
  no message
  
  Revision  Changes    Path
  1.14      +21 -41    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/DefaultController.java
  
  Index: DefaultController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/DefaultController.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultController.java	4 Aug 2002 14:58:30 -0000	1.13
  +++ DefaultController.java	8 Aug 2002 21:29:24 -0000	1.14
  @@ -81,7 +81,7 @@
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
    * @version $Revision$ $Date$
    */
  -public class DefaultController implements Controller, Initializable, Startable, Disposable
  +public class DefaultController implements Initializable, Startable, Disposable
   {
       //=======================================================================
       // static
  @@ -224,16 +224,32 @@
       */
       public void start() throws Exception
       {
  -        startup();
  +        if( m_status < INITIALIZED )
  +          throw new ControllerException( "Controller has not been initialized." );
  +        if( m_status > STARTED )
  +        {
  +            if( m_status < STOPPED )
  +              throw new ControllerException( "Controller already running." );
  +            if( m_status == STOPPED )
  +              throw new ControllerException( "Controller was stopped." );
  +            if( m_status == DISPOSED )
  +              throw new ControllerException( "Controller was disposed." );
  +        }
  +        m_kernel.start();
  +        m_status = STARTED;
       }
   
      /**
       * Invoked by a contrainer to request shutdown of the controller.  Thie implementation
       * simply invokes the {@link #startup} operation.
       */
  -    public void stop()
  +    public void stop() throws Exception
       {
  -        shutdown();
  +        if( m_status == STARTED )
  +        {
  +            m_kernel.stop();
  +            m_status = STOPPED;
  +        }
       }
   
       //=======================================================================
  @@ -252,42 +268,6 @@
               
           }
           m_status = DISPOSED;
  -    }
  -
  -    //=======================================================================
  -    // Controller
  -    //=======================================================================
  -
  -   /**
  -    * Request the startup of the manageable unit.
  -    */
  -    public void startup() throws Exception
  -    {
  -        if( m_status < INITIALIZED )
  -          throw new ControllerException( "Controller has not been initialized." );
  -        if( m_status > STARTED )
  -        {
  -            if( m_status < STOPPED )
  -              throw new ControllerException( "Controller already running." );
  -            if( m_status == STOPPED )
  -              throw new ControllerException( "Controller was stopped." );
  -            if( m_status == DISPOSED )
  -              throw new ControllerException( "Controller was disposed." );
  -        }
  -        m_kernel.startup();
  -        m_status = STARTED;
  -    }
  -
  -   /**
  -    * Request the shutdown of the manageable unit.
  -    */
  -    public void shutdown()
  -    {
  -        if( m_status == STARTED )
  -        {
  -            m_kernel.shutdown();
  -            m_status = STOPPED;
  -        }
       }
   
       //=======================================================================
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message