Peter Donald wrote:
> 
> Hi,
> 
> What do you think about adding an interface such as
> 
> package org.apache.avalon.framework.activity;
> 
> interface Executable
> {
>   void execute() throws Exception;
> }
> 
> The main reason it wasn't accepted last time I lobbied for it was that it was
> too like Runnable. However the one difference is that it allows an exception
> to be thrown. This is important in a number of scenarios. Most importantly it
> will be important in upcoming threading code when I rework it ;)

Is this used for Callbacks?  The reason I ask is because I want to know if this
is designed for Components or light-weight executable objects.  That is what the
"Action" interface below seems to infer.  The "Executable" interface seems too
broad in scope for my tastes.

> It will also reduce duplication across a number of projects I work on (all of
> which have an equivelent interface). The other style interface I use is
> 
> interface Action
> {
>   void performAction() throws Exception;
> }
> 
> However that clashes with the swing framework so I would prefer to use
> Executable if at all possible ;)

If you are talking about callbacks (such as for the Scheduler and thread pooling),
then I am +1--but the naming needs to be more narrow to reflect that.

S/MIME Cryptographic Signature

Reply via email to