nl.tudelft.simulation.messaging.devices.components
Class SendingReceivingDevice

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.messaging.devices.components.Device
          extended bynl.tudelft.simulation.messaging.devices.components.SendingReceivingDevice
All Implemented Interfaces:
DeviceInterface, java.util.EventListener, nl.tudelft.simulation.event.EventListenerInterface, nl.tudelft.simulation.event.EventProducerInterface, ReceivingDeviceInterface, SendingDeviceInterface, java.io.Serializable
Direct Known Subclasses:
EmailApplication, FaxDevice

public abstract class SendingReceivingDevice
extends Device
implements SendingDeviceInterface, ReceivingDeviceInterface, nl.tudelft.simulation.event.EventListenerInterface

A SendingReceivingDevice combines the sending device and receiving device in one aggregated object.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Version:
$$Revision: 1.3 $$ $$Date: 2005/04/08 11:29:12 $$
Author:
Peter Jacobs , Stijn-Pieter van Houten , Alexander Verbraeck
See Also:
Serialized Form

Field Summary
 
Fields inherited from class nl.tudelft.simulation.messaging.devices.components.Device
name
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.messaging.devices.components.DeviceInterface
STATE_CHANGE_EVENT
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Fields inherited from interface nl.tudelft.simulation.messaging.devices.components.ReceivingDeviceInterface
RECEIVED_NEW_MESSAGE_EVENT
 
Constructor Summary
SendingReceivingDevice(java.lang.String name, ReceivingDeviceInterface receiver, SendingDeviceInterface sender)
          constructs a new SendingReceivingDevice
 
Method Summary
 MessageQueueInterface getQueue()
          get the queue of messages that have already been received.
 void notify(nl.tudelft.simulation.event.EventInterface event)
           
 java.lang.Object receive(Message message)
          receives a message
 java.lang.Object send(Message message)
          sends a message
 
Methods inherited from class nl.tudelft.simulation.messaging.devices.components.Device
getDeviceType, getName, getState, getTransmissionDelay, getTransmissionFrequency, setState
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.messaging.devices.components.DeviceInterface
getDeviceType, getName, getState, getTransmissionDelay, getTransmissionFrequency
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 

Constructor Detail

SendingReceivingDevice

public SendingReceivingDevice(java.lang.String name,
                              ReceivingDeviceInterface receiver,
                              SendingDeviceInterface sender)
constructs a new SendingReceivingDevice

Parameters:
name - the name of the device
sender - the sending part of this device
receiver - the receiving part of this device
Method Detail

send

public java.lang.Object send(Message message)
Description copied from interface: SendingDeviceInterface
sends a message

Specified by:
send in interface SendingDeviceInterface
Parameters:
message - the message to be send
Returns:
acknowledgement
See Also:
SendingDeviceInterface.send(nl.tudelft.simulation.messaging.Message)

receive

public java.lang.Object receive(Message message)
Description copied from interface: ReceivingDeviceInterface
receives a message

Specified by:
receive in interface ReceivingDeviceInterface
Parameters:
message - the message
Returns:
acknowledgement
See Also:
ReceivingDeviceInterface.receive(nl.tudelft.simulation.messaging.Message)

getQueue

public MessageQueueInterface getQueue()
Description copied from interface: ReceivingDeviceInterface
get the queue of messages that have already been received.

Specified by:
getQueue in interface ReceivingDeviceInterface
Returns:
Returns the message queue.
See Also:
ReceivingDeviceInterface.getQueue()

notify

public void notify(nl.tudelft.simulation.event.EventInterface event)
Specified by:
notify in interface nl.tudelft.simulation.event.EventListenerInterface
See Also:
EventListenerInterface.notify(nl.tudelft.simulation.event.EventInterface)


Copyright © 2004-2005 Delft University of Technology, the Netherlands. All Rights Reserved.