View Javadoc
1   package org.djutils.event;
2   
3   import java.io.Serializable;
4   import java.rmi.RemoteException;
5   import java.util.EventListener;
6   
7   /**
8    * The EventListenerInterface creates a callback method for publishers to inform their clients. The EventListener and
9    * EventProducer together form a combination of the Publish-Subscribe design pattern and the Observer design pattern using the
10   * notify(event) method. See <a href="https://en.wikipedia.org/wiki/Publish-subscribe_pattern" target=
11   * "_blank">https://en.wikipedia.org/wiki/Publish-subscribe_pattern</a>,
12   * <a href="https://en.wikipedia.org/wiki/Observer_pattern" target="_blank">https://en.wikipedia.org/wiki/Observer_pattern</a>,
13   * and <a href="https://howtodoinjava.com/design-patterns/behavioral/observer-design-pattern/" target=
14   * "_blank">https://howtodoinjava.com/design-patterns/behavioral/observer-design-pattern/</a>.
15   * <p>
16   * Copyright (c) 2002-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
17   * for project information <a href="https://djutils.org" target="_blank"> https://djutils.org</a>. The DJUTILS project is
18   * distributed under a three-clause BSD-style license, which can be found at
19   * <a href="https://djutils.org/docs/license.html" target="_blank"> https://djutils.org/docs/license.html</a>. This class was
20   * originally part of the DSOL project, see <a href="https://simulation.tudelft.nl/dsol/manual" target="_blank">
21   * https://simulation.tudelft.nl/dsol/manual</a>.
22   * </p>
23   * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a>
24   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
25   */
26  public interface EventListenerInterface extends EventListener, Serializable
27  {
28      /**
29       * Notifies the event listener of an event. This operation forms the callback method of the asynchronous communication
30       * protocol expressed in the event package.
31       * @param event EventInterface; the event which is sent to the listener
32       * @throws RemoteException If a network connection failure occurs.
33       */
34      void notify(EventInterface event) throws RemoteException;
35  
36  }