1
2
3
4
5
6
7
8
9
10
11
12
13
14 package nl.tudelft.simulation.messaging.devices.components;
15
16 import nl.tudelft.simulation.event.EventType;
17 import nl.tudelft.simulation.messaging.Message;
18 import nl.tudelft.simulation.messaging.queues.MessageQueueInterface;
19
20 /***
21 * The ReceivingDeviceInterface, which extends the standard functionality of a
22 * device by adding a method to receive a message, and a method to retrieve the
23 * queue of messages that have already been received. <br>
24 * <br>
25 * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
26 * Delft, the Netherlands. All rights reserved.
27 *
28 * See for project information <a href="http://www.simulation.tudelft.nl/">
29 * www.simulation.tudelft.nl </a>.
30 *
31 * The source code and binary code of this software is proprietary information
32 * of Delft University of Technology.
33 *
34 * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
35 * Jacobs </a>, <a
36 * href="mailto:s.p.a.vanhouten@tbm.tudelft.nl">Stijn-Pieter van Houten
37 * </a>, <a
38 * href="http://www.tbm.tudelft.nl/webstaf/alexandv/index.htm">Alexander
39 * Verbraeck </a>
40 * @version $$Revision: 1.2 $$ $$Date: 2005/04/08 10:56:35 $$
41 */
42 public interface ReceivingDeviceInterface extends DeviceInterface
43 {
44 /*** The event to indicate we received a message */
45 EventType RECEIVED_NEW_MESSAGE_EVENT = new EventType(
46 "RECEIVED_NEW_MESSAGE_EVENT");
47
48 /***
49 * receives a message
50 *
51 * @param message the message
52 * @return acknowledgement
53 */
54 Object receive(Message message);
55
56 /***
57 * get the queue of messages that have already been received.
58 *
59 * @return Returns the message queue.
60 */
61 MessageQueueInterface getQueue();
62 }