@@ -0,0 +1,1669 @@
+package net.sf.kerner.utils.async;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Apublic abstract class AbstractAsyncTaskCallableNotifying%3CR, V%3E extends AbstractAsyncTaskCallable%3CR, V%3E %7B%0A%0A    public static interface Listener %7B%0A        void notify(Object o);%0A    %7D%0A%0A    public static enum State %7B%0A        WAITING, RUNNING, FINISHED_OK, FINISHED_BAD%0A    %7D%0A%0A    private final List%3CListener%3E listeners = new ArrayList%3CListener%3E();%0A%0A    private State state = State.WAITING;%0A%0A    private final String identifier;%0A%0A    public AbstractAsyncTaskCallableNotifying(final String identifier) %7B%0A        super();%0A        this.identifier = identifier;%0A    %7D%0A%0A    public synchronized void addAllListeners(final Collection%3C? extends Listener%3E listeners) %7B%0A        for (final Listener l : listeners) %7B%0A            this.listeners.add(l);%0A        %7D%0A    %7D%0A%0A    public synchronized void addListener(final Listener listener) %7B%0A        listeners.add(listener);%0A    %7D%0A%0A    public void doBefore() %7B%0A        synchronized (state) %7B%0A            state = State.RUNNING;%0A            notifyListeners(identifier + %22 : %22 + state);%0A        %7D%0A    %7D%0A%0A    public void doOnFailure(final Exception e) %7B%0A        synchronized (state) %7B%0A            state = State.FINISHED_BAD;%0A            notifyListeners(identifier + %22 : %22 + state);%0A        %7D%0A    %7D%0A%0A    public void doOnSucess(final R result) %7B%0A        synchronized (state) %7B%0A            state = State.FINISHED_OK;%0A            notifyListeners(identifier + %22 : %22 + state);%0A        %7D%0A    %7D%0A%0A    private void notifyListeners(final Object o) %7B%0A        for (final Listener l : listeners) %7B%0A            l.notify(o);%0A        %7D%0A    %7D%0A%7D%0A

Introduce AbstractAsyncTaskCallableNotifying.