You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by le...@apache.org on 2001/04/14 17:06:55 UTC

cvs commit: jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle SuspendException.java StopException.java StartException.java ResumeException.java Interruptable.java InitializationException.java Executable.java Commandable.java Command.java Suspendable.java Stoppable.java Startable.java Resumable.java Initializable.java

leosimons    01/04/14 08:06:55

  Modified:    proposal/4.0/src/java/org/apache/framework/lifecycle
                        Suspendable.java Stoppable.java Startable.java
                        Resumable.java Initializable.java
  Added:       proposal/4.0/src/java/org/apache/framework/lifecycle
                        SuspendException.java StopException.java
                        StartException.java ResumeException.java
                        Interruptable.java InitializationException.java
                        Executable.java Commandable.java Command.java
  Log:
  updating the lifecycle methods as discussed.
  
  Revision  Changes    Path
  1.2       +5 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Suspendable.java
  
  Index: Suspendable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Suspendable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Suspendable.java	2001/03/15 04:35:06	1.1
  +++ Suspendable.java	2001/04/14 15:06:52	1.2
  @@ -12,12 +12,15 @@
    * The execution may be halted so that you can reconfigure/
    * recompose/recontextualize component
    *
  + * @deprecated As of 4-14-2001, this interface has been deprecated in favor of the new Interruptable interface.
  + *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
  + * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
    */
  -public interface Suspendable 
  +public interface Suspendable
   {
       /**
        * Suspends the component.
        */
  -    void suspend();
  +    void suspend() throws SuspendException;
   }
  
  
  
  1.2       +5 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Stoppable.java
  
  Index: Stoppable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Stoppable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Stoppable.java	2001/03/15 04:35:06	1.1
  +++ Stoppable.java	2001/04/14 15:06:53	1.2
  @@ -11,15 +11,18 @@
    * This interface is the dual interface of the <code>java.lang.Runnable</code>
    * interface and provides a hook to safely stop the thread of execution.
    *
  + * @deprecated As of 4-14-2001, this interface has been deprecated in favor of the new Executable interface.
  + *
    * @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  + * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
    */
  -public interface Stoppable 
  +public interface Stoppable
   {
       /**
        * Stops the current thread of execution.
        */
       void stop()
  -        throws Exception;
  +        throws StopException;
   }
  
  
  
  1.2       +5 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Startable.java
  
  Index: Startable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Startable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Startable.java	2001/03/15 04:35:06	1.1
  +++ Startable.java	2001/04/14 15:06:53	1.2
  @@ -13,13 +13,16 @@
    * It provides a method through which components can be "started"
    * without requiring a thread. Useful for reactive or passive objects.
    *
  + * @deprecated As of 4-14-2001, this interface has been deprecated in favor of the new Executable interface.
  + *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
  + * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
    */
  -public interface Startable 
  +public interface Startable
   {
       /**
        * Starts the component.
        */
       void start()
  -        throws Exception;
  +        throws StartException;
   }
  
  
  
  1.2       +5 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Resumable.java
  
  Index: Resumable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Resumable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resumable.java	2001/03/15 04:35:06	1.1
  +++ Resumable.java	2001/04/14 15:06:53	1.2
  @@ -11,12 +11,15 @@
    * This is used to restart execturion after temporarily halt.
    * The halt may have been for some re- configuring|composing|contextualizing
    *
  + * @deprecated As of 4-14-2001, this interface has been deprecated in favor of the new Interruptable interface.
  + *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
  + * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
    */
  -public interface Resumable 
  +public interface Resumable
   {
       /**
        * Resumes the component.
        */
  -    void resume();
  +    void resume() throws ResumeException;
   }
  
  
  
  1.2       +3 -2      jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Initializable.java
  
  Index: Initializable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Initializable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Initializable.java	2001/03/15 04:35:06	1.1
  +++ Initializable.java	2001/04/14 15:06:53	1.2
  @@ -16,15 +16,16 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
  + * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
    */
   public interface Initializable
   {
       /**
        * Initialize the service. This method is guaranteed to be called always
  -     * after methods in <code>Configurable</code> and <code>Component</code>, 
  +     * after methods in <code>Configurable</code> and <code>Component</code>,
        * if the class implements those interfaces and before the run() method
        * if the class implements <code>Runnable</code>.
        */
       void init()
  -        throws Exception;
  +        throws InitializationException;
   }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/SuspendException.java
  
  Index: SuspendException.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import org.apache.framework.CascadingRuntimeException;
  
  /**
   * Thrown when an <code>Interruptable</code> component cannot be suspended
   * properly.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public final class SuspendException
      extends CascadingRuntimeException
  {
      /**
       * Construct a new <code>SuspendException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public SuspendException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>SuspendException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public SuspendException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/StopException.java
  
  Index: StopException.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import org.apache.framework.CascadingRuntimeException;
  
  /**
   * Thrown when an <code>Executable</code> component cannot be stopped
   * properly.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public final class StopException
      extends CascadingRuntimeException
  {
      /**
       * Construct a new <code>StartException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public StopException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>StartException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public StopException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/StartException.java
  
  Index: StartException.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import org.apache.framework.CascadingRuntimeException;
  
  /**
   * Thrown when an <code>Executable</code> component cannot be started
   * properly.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public final class StartException
      extends CascadingRuntimeException
  {
      /**
       * Construct a new <code>StartException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public StartException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>StartException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public StartException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/ResumeException.java
  
  Index: ResumeException.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import org.apache.framework.CascadingRuntimeException;
  
  /**
   * Thrown when an <code>Interruptable</code> component cannot be resumed
   * properly.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public final class ResumeException
      extends CascadingRuntimeException
  {
      /**
       * Construct a new <code>ResumeException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public ResumeException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>ResumeException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public ResumeException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Interruptable.java
  
  Index: Interruptable.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  /**
   * This interface provides methods through which a component may be
   * suspended and resumed. See the lifecycle documentation for more
   * information.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public interface Interruptable extends Executable
  {
      /**
       * Suspends the component.
       */
      void suspend()
          throws SuspendException;
      /**
       * Resumes the component.
       */
      void resume()
          throws ResumeException;
  }
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/InitializationException.java
  
  Index: InitializationException.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import org.apache.framework.CascadingException;
  
  /**
   * Thrown when a <code>Initializable</code> component cannot be initialized
   * properly.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public final class InitializationException
      extends CascadingException
  {
      /**
       * Construct a new <code>InitializationException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public InitializationException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>InitializationException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public InitializationException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Executable.java
  
  Index: Executable.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  /**
   * This interface provides methods through which a component may be
   * started and stopped. See the lifecycle documentation for more
   * information.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public interface Executable extends Startable, Stoppable
  {
      /**
       * Starts the component.
       */
      void start()
          throws StartException;
      /**
       * Stops the component.
       */
      void stop()
          throws StopException;
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Commandable.java
  
  Index: Commandable.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import java.util.Iterator;
  
  /**
   * This interface represents a Component which has <code>Commands</code>
   * within it. A Command is a separate thread which is controlled by a
   * component's parent. See the lifecycle documentation for more information.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public interface Commandable
  {
      /**
       * Gets this component's Commands.
       *
       * @return a read-only iterator that contains this component's Commands.
       */
      Iterator getCommands();
  }
  
  
  
  1.1                  jakarta-avalon/proposal/4.0/src/java/org/apache/framework/lifecycle/Command.java
  
  Index: Command.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.framework.lifecycle;
  
  import java.lang.Runnable;
  
  /**
   * A Command is a basic unit of work. They're usually run inside separate
   * threads.
   *
   * @author <a href="mailto:mail@leosimons.com">Leo Simons</a>
   */
  public interface Command extends Runnable
  {
      /**
       * Run this Command.
       */
      void run();
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org