Jody Garnett a écrit :
> Hi Martin this is not proving an effective use of either of our time; I 
> am not sure you understand the design of Executor/Callable/Future.

I'm using them in production (through MosaicImageWriter) before I suggested 
those classes last Monday...

However I do not yet understand why the proposed interface could not spread the 
tasks across servers, and I wasn't seeing a cancel() method as a huge 
responsability (no need to synchronize; declaring the field as "volatile" is 
enough. Even if the developer fails to put a "volatile" keyword nothing will 
broke. The only consequence is that the process may take longer to stop).

Anyway. The reponsability aspect could be adressed by defining an abstract 
class 
rather than an interface:

   public abstract class Process<E> implements Callable<E> {
       public void cancel() {
           // To be implemented ourself.
       }

       public void addProgressListener(...) {
           // To be implemented ourself.
       }

       protected void fireProgress(float percent) {
           // A convenience method to be invoked by implementors.
       }
   }


I had a look at the proposed "process" module and I see Process, 
ProcessFactory, 
ProcessFactoryFinder, Parameter classes which seem a parallel architecture to 
Callable, Executor, ISO 19111 Parameter, etc. The proposed classes give me the 
feeling that Process needs to be obtained (and maybe executed - not sure) from 
a 
ProcessFactory which needs to be declared as services in META-INF/services/. I 
can see a need for that from a GUI point of view, but can we split in two parts?

1) A Process class implementing Callable. This class should be usable directly
    in java.util.concurrent by the user as he see fit, with only additional
    fonctionality for reporting progress and canceling. Users should be able to
    run this Process with the Executor of his choice.

2) A ProcessFactory which may be used (but not required)
    for creating process through:

    Process create(String name, Collection<Parameter> parameters);

        Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to