Browse Source

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
master
Peter Donald 24 years ago
parent
commit
e5a1a9f449
1 changed files with 13 additions and 9 deletions
  1. +13
    -9
      proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java

+ 13
- 9
proposal/myrmidon/src/java/org/apache/myrmidon/api/Task.java View File

@@ -10,14 +10,12 @@ package org.apache.myrmidon.api;
/** /**
* This is the interface that tasks implement to be executed in Myrmidon runtime. * 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 * 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. * The Components passed in via ComponentManager are determined by container.
* *
@@ -28,13 +26,19 @@ public interface Task
{ {
String ROLE = "org.apache.myrmidon.api.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. * Execute task.
* This method is called to perform actual work associated with 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() void execute()
throws TaskException; throws TaskException;


Loading…
Cancel
Save