001    /*
002     *  jDTAUS - DTAUS fileformat.
003     *  Copyright (c) 2005 Christian Schulte <cs@schulte.it>
004     *
005     *  This library is free software; you can redistribute it and/or
006     *  modify it under the terms of the GNU Lesser General Public
007     *  License as published by the Free Software Foundation; either
008     *  version 2.1 of the License, or any later version.
009     *
010     *  This library is distributed in the hope that it will be useful,
011     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
012     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013     *  Lesser General Public License for more details.
014     *
015     *  You should have received a copy of the GNU Lesser General Public
016     *  License along with this library; if not, write to the Free Software
017     *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
018     *
019     */
020    package org.jdtaus.core.monitor;
021    
022    /**
023     * {@code TaskEventSource} is implemented by classes firing
024     * {@code TaskEvent}s.
025     * <p>Example: Listening to all jDTAUS Core SPI compliant implementations in the
026     * system<br/><pre>
027     * TaskEventSource source =
028     *     (TaskEventSource) ContainerFactory.getContainer().
029     *     getImplementation(TaskEventSource.class, "jDTAUS Core SPI");
030     *
031     * source.addTaskListener(<i>your application's listener</i>);
032     * </pre></p>
033     *
034     * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
035     * @version $Id: TaskEventSource.java 1914 2007-03-01 02:20:44Z schulte2005 $
036     */
037    public interface TaskEventSource
038    {
039    
040        //--TaskEventSource---------------------------------------------------------
041    
042        /**
043         * Adds a {@code TaskListener} to the listener list.
044         *
045         * @param listener The listener to be added to the listener list.
046         *
047         * @throws NullPointerException if {@code listener} is {@code null}.
048         */
049        void addTaskListener(TaskListener listener);
050    
051        /**
052         * Removes a {@code TaskListener} from the listener list.
053         *
054         * @param listener The listener to be removed from the listener list.
055         *
056         * @throws NullPointerException if {@code listener} is {@code null}.
057         */
058        void removeTaskListener(TaskListener listener);
059    
060        /**
061         * Accessor to all currently registered {@code TaskListener}s.
062         *
063         * @return all currently registered {@code TaskListener}s.
064         */
065        TaskListener[] getTaskListeners();
066    
067        //---------------------------------------------------------TaskEventSource--
068    
069    }