You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2003/03/24 07:15:49 UTC

cvs commit: avalon/src/java/org/apache/avalon/framework/container ContainerUtil.java

donaldp     2003/03/23 22:15:49

  Modified:    src/java/org/apache/avalon/framework/container
                        ContainerUtil.java
  Log:
  Add in utility method to Execute object
  
  Revision  Changes    Path
  1.14      +18 -1     avalon/src/java/org/apache/avalon/framework/container/ContainerUtil.java
  
  Index: ContainerUtil.java
  ===================================================================
  RCS file: /home/cvs/avalon/src/java/org/apache/avalon/framework/container/ContainerUtil.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ContainerUtil.java	11 Feb 2003 15:58:40 -0000	1.13
  +++ ContainerUtil.java	24 Mar 2003 06:15:49 -0000	1.14
  @@ -57,6 +57,7 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  +import org.apache.avalon.framework.activity.Executable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -296,6 +297,22 @@
           if( object instanceof Startable )
           {
               ( (Startable)object ).start();
  +        }
  +    }
  +
  +    /**
  +     * Execute the specified object if it implements the
  +     * {@link Executable} interface.
  +     *
  +     * @param object the object to execute
  +     * @throws Exception if there is a problem executing object
  +     */
  +    public static void execute( final Object object )
  +        throws Exception
  +    {
  +        if( object instanceof Executable )
  +        {
  +            ( (Executable)object ).execute();
           }
       }
   
  
  
  

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


Re: cvs commit: avalon/src/java/org/apache/avalon/framework/container ContainerUtil.java

Posted by Leo Simons <le...@apache.org>.
Berin Loritsch wrote:
> donaldp@apache.org wrote:
> 
>  > donaldp     2003/03/23 22:15:49
>  >
>  >   Modified:    src/java/org/apache/avalon/framework/container
>  >                         ContainerUtil.java
>  >   Log:
>  >   Add in utility method to Execute object
> 
> I believe the last discussion on this ended with the conclusion
> that Runnable/Executable are *not* lifecycle methods, so therefore
> putting this support in ContainerUtil would be sending the wrong
> message.

Hi Berin,

/**
  * The Executable can be implemented by components that need to perform
  * some work. In many respects it is similar to Runnable except that it
  * also allows an application to throw a non-Runtime Exception.
  *
  * <p>The work done may be short lived (ie a simple task) or it could
  * be a long running.</p>
  *
  * @author <a href="mailto:dev@avalon.apache.org">Avalon Development 
Team</a>
  * @version CVS $Revision: 1.13 $ $Date: 2003/02/11 15:58:38 $
  */

is the only docs available. Can't quite remember how the discussion went 
either; but the docs don't really reflect any conclusions; in fact there 
is not much said at all about executable!

- LSD



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


Re: cvs commit: avalon/src/java/org/apache/avalon/framework/container ContainerUtil.java

Posted by Berin Loritsch <bl...@apache.org>.
donaldp@apache.org wrote:

 > donaldp     2003/03/23 22:15:49
 >
 >   Modified:    src/java/org/apache/avalon/framework/container
 >                         ContainerUtil.java
 >   Log:
 >   Add in utility method to Execute object



I wan't aware we as a community made this an official lifecycle
method.  We need to keep Framework as stable as possible.

I believe the last discussion on this ended with the conclusion
that Runnable/Executable are *not* lifecycle methods, so therefore
putting this support in ContainerUtil would be sending the wrong
message.


 >   +
 >   +    /**
 >   +     * Execute the specified object if it implements the
 >   +     * {@link Executable} interface.
 >   +     *
 >   +     * @param object the object to execute
 >   +     * @throws Exception if there is a problem executing object
 >   +     */
 >   +    public static void execute( final Object object )
 >   +        throws Exception
 >   +    {
 >   +        if( object instanceof Executable )
 >   +        {
 >   +            ( (Executable)object ).execute();
 >            }
 >        }
 >





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


Re: cvs commit: avalon/src/java/org/apache/avalon/framework/container ContainerUtil.java

Posted by Berin Loritsch <bl...@apache.org>.
donaldp@apache.org wrote:

 > donaldp     2003/03/23 22:15:49
 >
 >   Modified:    src/java/org/apache/avalon/framework/container
 >                         ContainerUtil.java
 >   Log:
 >   Add in utility method to Execute object



I wan't aware we as a community made this an official lifecycle
method.  We need to keep Framework as stable as possible.

I believe the last discussion on this ended with the conclusion
that Runnable/Executable are *not* lifecycle methods, so therefore
putting this support in ContainerUtil would be sending the wrong
message.


 >   +
 >   +    /**
 >   +     * Execute the specified object if it implements the
 >   +     * {@link Executable} interface.
 >   +     *
 >   +     * @param object the object to execute
 >   +     * @throws Exception if there is a problem executing object
 >   +     */
 >   +    public static void execute( final Object object )
 >   +        throws Exception
 >   +    {
 >   +        if( object instanceof Executable )
 >   +        {
 >   +            ( (Executable)object ).execute();
 >            }
 >        }
 >





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