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