From 29ee64b2716fbac913f1817135eb8d5bf20434ba Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Mon, 4 Jun 2001 12:38:18 +0000 Subject: [PATCH] Starting to define/test aspect interface. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269093 13f79535-47bb-0310-9956-ffa450edef68 --- .../aspects/AbstractAspectHandler.java | 60 +++++++++++++++++++ .../myrmidon/aspects/AspectHandler.java | 43 +++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java create mode 100644 proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java new file mode 100644 index 000000000..ab6440594 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java @@ -0,0 +1,60 @@ +/* + * 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.log.Logger; +import org.apache.myrmidon.api.Task; +import org.apache.myrmidon.api.TaskException; + +/** + * AspectHandler is the interface through which aspects are handled. + * + * @author Conor MacNeill + * @author Peter Donald + */ +public abstract class AbstractAspectHandler + implements AspectHandler +{ + public Configuration preCreate( final Configuration configuration ) + throws TaskException + { + return configuration; + } + + public void postCreate( final Task task ) + throws TaskException + { + } + + public void preLoggable( final Logger logger ) + throws TaskException + { + } + + public void preConfigure() + throws TaskException + { + } + + public void preExecute() + throws TaskException + { + } + + public void preDestroy() + throws TaskException + { + } + + public boolean error( final TaskException te ) + throws TaskException + { + return false; + } +} diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java new file mode 100644 index 000000000..f3159ab95 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java @@ -0,0 +1,43 @@ +/* + * 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.log.Logger; +import org.apache.myrmidon.api.Task; +import org.apache.myrmidon.api.TaskException; + +/** + * AspectHandler is the interface through which aspects are handled. + * + * @author Conor MacNeill + * @author Peter Donald + */ +public interface AspectHandler +{ + Configuration preCreate( Configuration configuration ) + throws TaskException; + + void postCreate( Task task ) + throws TaskException; + + void preLoggable( Logger logger ) + throws TaskException; + + void preConfigure() + throws TaskException; + + void preExecute() + throws TaskException; + + void preDestroy() + throws TaskException; + + boolean error( TaskException te ) + throws TaskException; +}