From e5a1a9f449bc2d1b504bf22ed6304e665031cf63 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 24 Jan 2002 11:35:37 +0000 Subject: [PATCH] Made tasks receive contexts directly rather than through Contextualizable interface as all tasks will most likely use the context in soem fashion git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270837 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/myrmidon/api/Task.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java index 5e303c2b2..ebcf620b2 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java @@ -10,14 +10,12 @@ package org.apache.myrmidon.api; /** * This is the interface that tasks implement to be executed in Myrmidon runtime. * - * Instances can also implement the Avalon lifecycle methods - * LogEnabled, Contextualizable, Composable, Initializable and Disposable. - * Each of these lifecycle stages will be executed at appropriate time. + * Instances can also implement the Avalon LogEnabled method to receive a logger. * - * Tasks can also choose to implement Configurable if they wish to directly + * Tasks can also choose to implement Avalon Configurable if they wish to directly * receive the Configuration data representing the task. If this interface is - * not implemented then the engine will be responsbil for mapping configuration - * to task object. + * not implemented then the container will be responsble for mapping configuration + * onto the task object. * * The Components passed in via ComponentManager are determined by container. * @@ -28,13 +26,19 @@ public interface Task { String ROLE = "org.apache.myrmidon.api.Task"; + /** + * Specify the context in which the task operates in. + * The Task will use the TaskContext to receive information + * about it's environment. + */ + void contextualize( TaskContext context ); + /** * Execute task. * This method is called to perform actual work associated with task. - * It is called after Task has been Configured and Initialized and before - * being Disposed (If task implements appropriate interfaces). + * It is called after Task has been Configured. * - * @exception TaskException if an error occurs + * @exception TaskException if task fails to execute */ void execute() throws TaskException;