001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: */
018:
019: package org.apache.tools.ant;
020:
021: import java.util.EventListener;
022:
023: /**
024: * Instances of classes that implement this interface can register
025: * to be notified when things happened during a build.
026: *
027: * @see BuildEvent
028: * @see Project#addBuildListener(BuildListener)
029: *
030: */
031: public interface BuildListener extends EventListener {
032:
033: /**
034: * Signals that a build has started. This event
035: * is fired before any targets have started.
036: *
037: * @param event An event with any relevant extra information.
038: * Must not be <code>null</code>.
039: */
040: void buildStarted(BuildEvent event);
041:
042: /**
043: * Signals that the last target has finished. This event
044: * will still be fired if an error occurred during the build.
045: *
046: * @param event An event with any relevant extra information.
047: * Must not be <code>null</code>.
048: *
049: * @see BuildEvent#getException()
050: */
051: void buildFinished(BuildEvent event);
052:
053: /**
054: * Signals that a target is starting.
055: *
056: * @param event An event with any relevant extra information.
057: * Must not be <code>null</code>.
058: *
059: * @see BuildEvent#getTarget()
060: */
061: void targetStarted(BuildEvent event);
062:
063: /**
064: * Signals that a target has finished. This event will
065: * still be fired if an error occurred during the build.
066: *
067: * @param event An event with any relevant extra information.
068: * Must not be <code>null</code>.
069: *
070: * @see BuildEvent#getException()
071: */
072: void targetFinished(BuildEvent event);
073:
074: /**
075: * Signals that a task is starting.
076: *
077: * @param event An event with any relevant extra information.
078: * Must not be <code>null</code>.
079: *
080: * @see BuildEvent#getTask()
081: */
082: void taskStarted(BuildEvent event);
083:
084: /**
085: * Signals that a task has finished. This event will still
086: * be fired if an error occurred during the build.
087: *
088: * @param event An event with any relevant extra information.
089: * Must not be <code>null</code>.
090: *
091: * @see BuildEvent#getException()
092: */
093: void taskFinished(BuildEvent event);
094:
095: /**
096: * Signals a message logging event.
097: *
098: * @param event An event with any relevant extra information.
099: * Must not be <code>null</code>.
100: *
101: * @see BuildEvent#getMessage()
102: * @see BuildEvent#getException()
103: * @see BuildEvent#getPriority()
104: */
105: void messageLogged(BuildEvent event);
106: }
|