001 package com.hammurapi.util.concurrent;
002
003 /**
004 * Callback interface for tasks created by synapses.
005 * Flow implementations provide implementation of this interface
006 * for synchronization purposes, e.g. to wait for completion of all
007 * flow tasks.
008 * @author Pavel Vlasov
009 */
010 public interface TaskCounter {
011
012 /**
013 * Invoked when a new task has been created and about to
014 * be sent to execution.
015 * @param task
016 */
017 void onTaskCreated(Runnable task);
018
019 /**
020 * Invoked when a task finished execution.
021 * @param task
022 */
023 void onTaskFinished(Runnable task);
024 }