It has a set of un-ordered attributes with each attribute mapping - * a key to a value. The ModelElement can also have either a set of ordered - * sub-elements or text content (one or the other - not both).
- * - * @author Peter Donald - * @version $Revision$ $Date$ - */ -public class ModelElement -{ - /** - * Return an array containing all the childModelElement
s
- * that are contained within this ModelElement
. If this method
- * returns an array containing 1 or more elements then it must return null
- * for getContent() method.
- *
- * @todo determine whether we return null or an empty array when no
- * child elements.
- * @return all the child ModelElement
s
- * @see #getContent()
- */
- public ModelElement[] getChildren()
- {
- return null;
- }
-
- /**
- * Return an array containing the names of all the attributes stored
- * in this ModelElement
. The user can then pass these
- * parameters into the getAttribute() method of this class to get the
- * value of the attribute.
- *
- * @return an array of the attribute names
- * @see #getAttribute(String)
- */
- public String[] getAttributeNames()
- {
- return null;
- }
-
- /**
- * Get the value of the attribute passed in.
- * If no such attribute exists return null.
- *
- * @param name the name of the attribute to retrieve value for
- * @return the value of the attribute with specified name or null
- * if no such element.
- */
- public String getAttribute( final String name )
- {
- return null;
- }
-
- /**
- * Retrieve the content of this element if any. Will return
- * null if no content available. Note it is invalid for this
- * method to return a non-null value and the getChildren()
- * method to return an array of 1 or more child elements.
- *
- * @return the content value if any, else null
- * @see #getChildren()
- */
- public String getContent()
- {
- return null;
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata/Modeller.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata/Modeller.java
deleted file mode 100644
index 1f95fdc4b..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/metadata/Modeller.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.api.metadata;
-
-/**
- * The Modeller interface specifies that the implementing object
- * wishes to handle its own configuration stage. In which case the
- * object is passed the ModelElement representing itself and it uses
- * the element to configure itself.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- * @see ModelElement
- */
-public interface Modeller
-{
- /**
- * Pass the object a read-only instance of it's own
- * model.
- *
- * @param element the ModelElement representing object
- */
- void model( ModelElement element );
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/metainfo/TaskInfo.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/metainfo/TaskInfo.java
deleted file mode 100644
index 859c78578..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/metainfo/TaskInfo.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.api.metainfo;
-
-/**
- * This class represents the metadata about the task type.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- */
-public class TaskInfo
-{
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java
deleted file mode 100644
index c1d8db691..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AbstractAspectHandler.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.aspects;
-
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.parameters.Parameters;
-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
- * @version $Revision$ $Date$
- */
-public abstract class AbstractAspectHandler
- implements AspectHandler
-{
- private Parameters m_aspectParameters;
- private Configuration[] m_aspectElements;
-
- private Task m_task;
- private Logger m_logger;
- private Configuration m_taskModel;
-
- public Configuration preCreate( final Configuration taskModel )
- throws TaskException
- {
- return taskModel;
- }
-
- public void aspectSettings( final Parameters parameters, final Configuration[] elements )
- throws TaskException
- {
- m_aspectParameters = parameters;
- m_aspectElements = elements;
- }
-
- public void postCreate( final Task task )
- throws TaskException
- {
- m_task = task;
- }
-
- public void preLogEnabled( final Logger logger )
- throws TaskException
- {
- m_logger = logger;
- }
-
- public void preConfigure( final Configuration taskModel )
- throws TaskException
- {
- m_taskModel = taskModel;
- }
-
- public void preExecute()
- throws TaskException
- {
- }
-
- public void preDestroy()
- throws TaskException
- {
- reset();
- }
-
- public boolean error( final TaskException te )
- throws TaskException
- {
- reset();
- return false;
- }
-
- protected void reset()
- {
- m_aspectParameters = null;
- m_aspectElements = null;
- m_task = null;
- m_logger = null;
- m_taskModel = null;
- }
-
- protected final Configuration getTaskModel()
- {
- return m_taskModel;
- }
-
- protected final Task getTask()
- {
- return m_task;
- }
-
- protected final Logger getLogger()
- {
- return m_logger;
- }
-
- protected final Configuration[] getAspectElements()
- {
- return m_aspectElements;
- }
-
- protected final Parameters getAspectParameters()
- {
- return m_aspectParameters;
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java
deleted file mode 100644
index dcece5851..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/AspectHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.aspects;
-
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.parameters.Parameters;
-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
- * @version $Revision$ $Date$
- * @ant:role shorthand="aspect"
- */
-public interface AspectHandler
-{
- String ROLE = AspectHandler.class.getName();
-
- Configuration preCreate( Configuration taskModel )
- throws TaskException;
-
- void aspectSettings( Parameters parameters, Configuration[] children )
- throws TaskException;
-
- void postCreate( Task task )
- throws TaskException;
-
- void preLogEnabled( Logger logger )
- throws TaskException;
-
- void preConfigure( Configuration taskModel )
- throws TaskException;
-
- void preExecute()
- throws TaskException;
-
- void preDestroy()
- throws TaskException;
-
- boolean error( TaskException te )
- throws TaskException;
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/NoopAspectHandler.java b/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/NoopAspectHandler.java
deleted file mode 100644
index b65301728..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/aspects/NoopAspectHandler.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.aspects;
-
-/**
- * A Noop aspect handler that does nothing.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- * @ant.type type="aspect" name="noop"
- */
-public class NoopAspectHandler
- extends AbstractAspectHandler
-{
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java
deleted file mode 100644
index 05865a2c8..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * Abstract listener from which to extend. This implementation provedes
- * empty implementions of each of the event methods.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- */
-public abstract class AbstractProjectListener
- implements ProjectListener
-{
- /**
- * Notify listener of projectStarted event.
- */
- public void projectStarted( final ProjectEvent event )
- {
- }
-
- /**
- * Notify listener of projectFinished event.
- */
- public void projectFinished( final ProjectEvent event )
- {
- }
-
- /**
- * Notify listener of targetStarted event.
- */
- public void targetStarted( final TargetEvent event )
- {
- }
-
- /**
- * Notify listener of targetFinished event.
- */
- public void targetFinished( final TargetEvent event )
- {
- }
-
- /**
- * Notify listener of taskStarted event.
- */
- public void taskStarted( final TaskEvent event )
- {
- }
-
- /**
- * Notify listener of taskFinished event.
- */
- public void taskFinished( final TaskEvent event )
- {
- }
-
- /**
- * Notify listener of log message event.
- */
- public void log( final LogEvent event )
- {
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ClassicProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ClassicProjectListener.java
deleted file mode 100644
index e73a79bbb..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ClassicProjectListener.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-import java.io.PrintWriter;
-import org.apache.avalon.framework.ExceptionUtil;
-
-/**
- * Classic listener that emulates the default ant1.x listener.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- * @ant.type type="listener" name="classic"
- */
-public class ClassicProjectListener
- extends AbstractProjectListener
-{
- private final PrintWriter m_printWriter;
-
- public ClassicProjectListener()
- {
- m_printWriter = new PrintWriter( System.out, true );
- }
-
- /**
- * Notify listener of targetStarted event.
- */
- public void targetStarted( final TargetEvent event )
- {
- writeTargetHeader( event );
- }
-
- /**
- * Notify listener of targetFinished event.
- */
- public void targetFinished( TargetEvent event )
- {
- getWriter().println();
- }
-
- /**
- * Notify listener of log message event.
- */
- public void log( final LogEvent event )
- {
- writeMessage( event );
- writeThrowable( event );
- }
-
- /**
- * Returns the PrintWriter to write to.
- */
- protected PrintWriter getWriter()
- {
- return m_printWriter;
- }
-
- /**
- * Writes the target header.
- */
- protected void writeTargetHeader( final TargetEvent event )
- {
- getWriter().println( event.getTargetName() + ":" );
- }
-
- /**
- * Writes a message
- */
- protected void writeMessage( final LogEvent event )
- {
- // Write the message
- final String message = event.getMessage();
- final String task = event.getTaskName();
- if( null != task )
- {
- getWriter().println( "\t[" + task + "] " + message );
- }
- else
- {
- getWriter().println( message );
- }
- }
-
- /**
- * Writes a throwable.
- */
- private void writeThrowable( final LogEvent event )
- {
- // Write the exception, if any
- final Throwable throwable = event.getThrowable();
- if( throwable != null )
- {
- getWriter().println( ExceptionUtil.printStackTrace( throwable, 8, true ) );
- }
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java
deleted file mode 100644
index 7fb958d80..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * Default listener that emulates the Ant 1.x no banner listener.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- * @ant.type type="listener" name="default"
- */
-public class DefaultProjectListener
- extends ClassicProjectListener
-{
- private boolean m_targetOutput;
-
- /**
- * Notify listener of targetStarted event.
- */
- public void targetStarted( final TargetEvent target )
- {
- m_targetOutput = false;
- }
-
- /**
- * Notify listener of targetFinished event.
- */
- public void targetFinished( final TargetEvent event )
- {
- if( m_targetOutput )
- {
- getWriter().println();
- }
- }
-
- /**
- * Notify listener of log message event.
- */
- public void log( final LogEvent event )
- {
- // Write the target header, if necessary
- final String target = event.getTargetName();
- if( target != null && !m_targetOutput )
- {
- writeTargetHeader( event );
- m_targetOutput = true;
- }
-
- // Write the message
- super.log( event );
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/LogEvent.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/LogEvent.java
deleted file mode 100644
index e14a58383..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/LogEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * A log message event.
- *
- * @author Adam Murdoch
- * @version $Revision$ $Date$
- */
-public interface LogEvent
- extends TaskEvent
-{
- /**
- * Returns the message.
- */
- String getMessage();
-
- /**
- * Returns the error that occurred.
- */
- Throwable getThrowable();
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/NoPrefixProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/NoPrefixProjectListener.java
deleted file mode 100644
index e7634310c..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/NoPrefixProjectListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * A project listener that emulated the Ant 1.x -emacs mode.
- *
- * @author Adam Murdoch
- * @version $Revision$ $Date$
- * @ant.type type="listener" name="noprefix"
- */
-public class NoPrefixProjectListener
- extends DefaultProjectListener
-{
- /**
- * Writes a message
- */
- protected void writeMessage( LogEvent event )
- {
- getWriter().println( event.getMessage() );
- }
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectEvent.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectEvent.java
deleted file mode 100644
index ae8a6fa49..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectEvent.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * A project level event.
- *
- * @author Adam Murdoch
- * @version $Revision$ $Date$
- */
-public interface ProjectEvent
-{
- /**
- * Returns the name of the project.
- */
- String getProjectName();
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectListener.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectListener.java
deleted file mode 100644
index c94c8aa18..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/ProjectListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * The interface to implement if you want to receive
- * notification of project status.
- *
- * @author Peter Donald
- * @version $Revision$ $Date$
- * @ant:role shorthand="listener"
- * @todo Think about having a way to indicate that a foreign project
- * is being referenced, a implicit target is being referenced
- * and that a library is being imported.
- */
-public interface ProjectListener
-{
- String ROLE = ProjectListener.class.getName();
-
- /**
- * Notify the listener that a project is about to start. This method
- * is called for top-level projects only.
- */
- void projectStarted( ProjectEvent event );
-
- /**
- * Notify the listener that a project has finished. This method is called
- * for top-level projects only.
- */
- void projectFinished( ProjectEvent event );
-
- /**
- * Notify the listener that a target is about to start. Note that the
- * project name reported by the event may be different to that reported
- * in {@link #projectStarted}.
- */
- void targetStarted( TargetEvent event );
-
- /**
- * Notify the listener that a target has finished.
- */
- void targetFinished( TargetEvent event );
-
- /**
- * Notify the listener that a task is about to start.
- */
- void taskStarted( TaskEvent event );
-
- /**
- * Notify the listener that a task has finished.
- */
- void taskFinished( TaskEvent event );
-
- /**
- * Notify listener of log message event. Note that this method may
- * be called at any time, so the reported task, target, or project names
- * may be null.
- */
- void log( LogEvent event );
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TargetEvent.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TargetEvent.java
deleted file mode 100644
index e6d282b2a..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TargetEvent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * A target level event.
- *
- * @author Adam Murdoch
- * @version $Revision$ $Date$
- */
-public interface TargetEvent
- extends ProjectEvent
-{
- /**
- * Returns the name of the target.
- */
- String getTargetName();
-}
diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TaskEvent.java b/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TaskEvent.java
deleted file mode 100644
index 3a3360aae..000000000
--- a/proposal/myrmidon/src/java/org/apache/myrmidon/listeners/TaskEvent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.txt file.
- */
-package org.apache.myrmidon.listeners;
-
-/**
- * A task level event.
- *
- * @author Adam Murdoch
- * @version $Revision$ $Date$
- */
-public interface TaskEvent
- extends TargetEvent
-{
- /**
- * Returns the name of the task.
- */
- String getTaskName();
-}