src/core/net/sf/basedb/util/extensions/events/EventHandler.java

Code
Comments
Other
Rev Date Author Line
4320 29 May 08 nicklas 1 /**
4320 29 May 08 nicklas 2   $Id$
4320 29 May 08 nicklas 3
4320 29 May 08 nicklas 4   Copyright (C) 2008 Nicklas Nordborg
4320 29 May 08 nicklas 5
4320 29 May 08 nicklas 6   This file is part of BASE - BioArray Software Environment.
4320 29 May 08 nicklas 7   Available at http://base.thep.lu.se/
4320 29 May 08 nicklas 8
4320 29 May 08 nicklas 9   BASE is free software; you can redistribute it and/or
4320 29 May 08 nicklas 10   modify it under the terms of the GNU General Public License
4479 05 Sep 08 jari 11   as published by the Free Software Foundation; either version 3
4320 29 May 08 nicklas 12   of the License, or (at your option) any later version.
4320 29 May 08 nicklas 13
4320 29 May 08 nicklas 14   BASE is distributed in the hope that it will be useful,
4320 29 May 08 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
4320 29 May 08 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4320 29 May 08 nicklas 17   GNU General Public License for more details.
4320 29 May 08 nicklas 18
4320 29 May 08 nicklas 19   You should have received a copy of the GNU General Public License
4515 11 Sep 08 jari 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
4320 29 May 08 nicklas 21 */
4320 29 May 08 nicklas 22 package net.sf.basedb.util.extensions.events;
4320 29 May 08 nicklas 23
4320 29 May 08 nicklas 24 import java.util.EventListener;
4320 29 May 08 nicklas 25
4320 29 May 08 nicklas 26 import net.sf.basedb.util.extensions.Extension;
4320 29 May 08 nicklas 27 import net.sf.basedb.util.extensions.ExtensionPoint;
4320 29 May 08 nicklas 28
4320 29 May 08 nicklas 29 /**
4320 29 May 08 nicklas 30   An event handler receives events about things happening to 
4320 29 May 08 nicklas 31   extensions and extension points. For example, when they
4320 29 May 08 nicklas 32   are registered or updated. An event handler is usually paired with
4320 29 May 08 nicklas 33   an {@link EventFilter} that sorts out which types of event that should be
4320 29 May 08 nicklas 34   sent to the event handler.
4320 29 May 08 nicklas 35
4320 29 May 08 nicklas 36   @author nicklas
4320 29 May 08 nicklas 37   @version 2.8
4320 29 May 08 nicklas 38   @base.modified $Date$
4320 29 May 08 nicklas 39 */
4320 29 May 08 nicklas 40 public interface EventHandler
4320 29 May 08 nicklas 41   extends EventListener
4320 29 May 08 nicklas 42 {
4320 29 May 08 nicklas 43   
4320 29 May 08 nicklas 44   /**
4320 29 May 08 nicklas 45     Handle an event. Since the types of events are likely to expand in the
4320 29 May 08 nicklas 46     future, we recommend that the event handler is written so that it
4320 29 May 08 nicklas 47     only responds to specific event types or that it is paired with an
4320 29 May 08 nicklas 48     {@link EventFilter} that filters out undesired events.
4320 29 May 08 nicklas 49     
4320 29 May 08 nicklas 50     @param event The event that happend
4320 29 May 08 nicklas 51     @param extensionPoint The extension point that the extension
4320 29 May 08 nicklas 52       extends, or that the event happened to
4320 29 May 08 nicklas 53     @param extension The extension the event happend to, or null if the
4320 29 May 08 nicklas 54       event happended to the extension point
4320 29 May 08 nicklas 55   */
4320 29 May 08 nicklas 56   public void handleEvent(EventType event, 
4320 29 May 08 nicklas 57       ExtensionPoint<?> extensionPoint, Extension<?> extension);
4320 29 May 08 nicklas 58
4320 29 May 08 nicklas 59 }