Hi, just had a whack at an interface that tried to fit all the different types of Aspects in. I have attached it and are interested in any feedback.
A few things to consider. It currently uses Configuration objects for TaskModel but this will be changed to whatever format Ant2 uses. Also it has a separate method at start that takes task-model and returns a task-model. This is to allow aspects who want to modify TaskModel including adding new aspect parameters to model. Is there any feature this doesn't support that you would find useful ? or any other thoughts?
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org.apache.myrmidon.aspects; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.parameters.Parameters; import org.apache.log.Logger; import org.apache.myrmidon.api.Task; import org.apache.myrmidon.api.TaskException; /** * AspectHandler is the interface through which aspects are handled. * * @author <a href="mailto:[EMAIL PROTECTED]">Conor MacNeill</a> * @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a> */ public interface AspectHandler { Configuration preCreate( Configuration taskModel ) throws TaskException; void aspect( Parameters parameters, Configuration[] children ) throws TaskException; void postCreate( Task task ) throws TaskException; void preLoggable( Logger logger ) throws TaskException; void preConfigure( Configuration taskModel ) throws TaskException; void preExecute() throws TaskException; void preDestroy() throws TaskException; boolean error( TaskException te ) throws TaskException; }
Cheers, Pete *-----------------------------------------------------* | "Faced with the choice between changing one's mind, | | and proving that there is no need to do so - almost | | everyone gets busy on the proof." | | - John Kenneth Galbraith | *-----------------------------------------------------*
