001/* 002 * jDTAUS Core API 003 * Copyright (C) 2005 Christian Schulte 004 * <cs@schulte.it> 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License, or any later version. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 019 * 020 */ 021package org.jdtaus.core.text; 022 023/** 024 * {@code MessageEventSource} is implemented by classes firing 025 * {@code MessageEvent}s. 026 * <p>Example: Listening to all jDTAUS Core SPI compliant implementations in the 027 * system<blockquote><pre> 028 * MessageEventSource source = 029 * (MessageEventSource) ContainerFactory.getContainer(). 030 * getObject( MessageEventSource.class ); 031 * 032 * source.addMessageListener(<i>your application's listener</i>); 033 * </pre></blockquote></p> 034 * 035 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 036 * @version $JDTAUS: MessageEventSource.java 8641 2012-09-27 06:45:17Z schulte $ 037 */ 038public interface MessageEventSource 039{ 040 //--MessageEventSource------------------------------------------------------ 041 042 /** 043 * Adds a {@code MessageListener} 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 addMessageListener( MessageListener listener ); 050 051 /** 052 * Removes a {@code MessageListener} 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 removeMessageListener( MessageListener listener ); 059 060 /** 061 * Gets all currently registered {@code MessageListener}s. 062 * 063 * @return all currently registered {@code MessageListener}s. 064 */ 065 MessageListener[] getMessageListeners(); 066 067 //------------------------------------------------------MessageEventSource-- 068}