1
2
3
4
5
6
7
8 package nl.tudelft.simulation.event.remote;
9
10 import java.rmi.RemoteException;
11 import java.rmi.server.UnicastRemoteObject;
12 import java.util.logging.Logger;
13
14 import nl.tudelft.simulation.event.EventInterface;
15 import nl.tudelft.simulation.event.EventListenerInterface;
16
17 /***
18 * The RemoteEventListener class embodies a remoteEventListener.
19 * <p>
20 * (c) copyright 2002-2005 <a href="http://www.simulation.tudelft.nl">Delft
21 * University of Technology </a>, the Netherlands.
22 * <p>
23 * See for project information <a
24 * href="http://www.simulation.tudelft.nl/dsol/event">www.simulation.tudelft.nl/event
25 * </a> <br>
26 * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
27 * General Public License (LGPL) </a>, no warranty
28 *
29 * @version $Revision: 1.5 $ $Date: 2005/07/04 12:23:00 $
30 * @author <a
31 * href="mailto:stijnh@tbm.tudelft.nl">Stijn-Pieter
32 * van Houten </a>
33 */
34 public class RemoteEventListener implements RemoteEventListenerInterface
35 {
36
37 /*** the owner of the remote listener */
38 private EventListenerInterface owner = null;
39
40 /***
41 * Constructs a new RemoteListener.
42 *
43 * @param owner The owner of the listener.
44 */
45 public RemoteEventListener(final EventListenerInterface owner)
46 {
47 super();
48 try
49 {
50 UnicastRemoteObject.exportObject(this);
51 } catch (RemoteException remoteException)
52 {
53 Logger.getLogger("nl.tudelft.simulation.event").severe(
54 remoteException.getMessage());
55 }
56
57 this.owner = owner;
58 }
59
60 /***
61 * @see nl.tudelft.simulation.event.EventListenerInterface#notify(nl.tudelft.simulation.event.EventInterface)
62 */
63 public void notify(final EventInterface event) throws RemoteException
64 {
65 this.owner.notify(event);
66 }
67 }