From 002901b2d9aea86cab7d4f770b7a20367136c37f Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 16 Dec 2001 05:19:35 +0000 Subject: [PATCH] Start to refactor and clean myrmidons listeners. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270199 13f79535-47bb-0310-9956-ffa450edef68 --- .../listeners/AbstractProjectListener.java | 84 +++++++++++++++++++ .../listeners/DefaultProjectListener.java | 23 +---- 2 files changed, 85 insertions(+), 22 deletions(-) create mode 100644 proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java new file mode 100644 index 000000000..b29db18ad --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java @@ -0,0 +1,84 @@ +/* + * 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.listeners; + +import org.apache.avalon.framework.ExceptionUtil; + +/** + * Abstract listener from which to extend. + * + * @author Peter Donald + */ +public abstract class AbstractProjectListener + implements ProjectListener +{ + /** + * Notify listener of projectStarted event. + */ + public void projectStarted() + { + } + + /** + * Notify listener of projectFinished event. + */ + public void projectFinished() + { + } + + /** + * Notify listener of targetStarted event. + * + * @param targetName the name of target + */ + public void targetStarted( final String targetName ) + { + } + + /** + * Notify listener of targetFinished event. + */ + public void targetFinished() + { + } + + /** + * Notify listener of taskStarted event. + * + * @param taskName the name of task + */ + public void taskStarted( final String taskName ) + { + } + + /** + * Notify listener of taskFinished event. + */ + public void taskFinished() + { + } + + /** + * Notify listener of log message event. + * + * @param message the message + */ + public void log( String message ) + { + } + + /** + * Notify listener of log message event. + * + * @param message the message + * @param throwable the throwable + */ + public void log( String message, Throwable throwable ) + { + } +} diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java index cb8b8e922..d498982fd 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java @@ -15,24 +15,10 @@ import org.apache.avalon.framework.ExceptionUtil; * @author Peter Donald */ public class DefaultProjectListener - implements ProjectListener + extends AbstractProjectListener { private String m_prefix; - /** - * Notify listener of projectStarted event. - */ - public void projectStarted() - { - } - - /** - * Notify listener of projectFinished event. - */ - public void projectFinished() - { - } - /** * Notify listener of targetStarted event. * @@ -43,13 +29,6 @@ public class DefaultProjectListener output( targetName + ":\n" ); } - /** - * Notify listener of targetFinished event. - */ - public void targetFinished() - { - } - /** * Notify listener of taskStarted event. *