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

java.lang.Object
  extended bynl.tudelft.simulation.event.EventProducer
      extended bynl.tudelft.simulation.messaging.devices.components.Device
          extended bynl.tudelft.simulation.messaging.devices.components.SendingDevice
              extended bynl.tudelft.simulation.messaging.devices.components.QueuingSendingDevice
All Implemented Interfaces:
DeviceInterface, nl.tudelft.simulation.event.EventProducerInterface, SendingDeviceInterface, java.io.Serializable

public class QueuingSendingDevice
extends SendingDevice

Models a sending device with a queue of messages. The queue can be implemented as FiFo, LiFo, priority, or any other queuing mechanism that has been defined. The device just puts the messages in the queue; another mechanism (probably from the actor) needs to take out the messages from the queue.

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
static nl.tudelft.simulation.event.EventType NEW_MESSAGE_TO_SEND_EVENT
          The event to indicate there is a message ready to be sent
protected  MessageQueueInterface queue
          The queue to store the messages in
 
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
 
Constructor Summary
QueuingSendingDevice(java.lang.String name, DeviceType deviceType, int transmissionDelay, double transmissionFrequency, MessageQueueInterface queue)
          constructs a new sending device with a message queue, override the default transmission delay and frequency from the DeviceType.
QueuingSendingDevice(java.lang.String name, DeviceType deviceType, MessageQueueInterface queue)
          constructs a new sending device with a message queue, override the default transmission delay and frequency from the DeviceType.
 
Method Summary
 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
 

Field Detail

NEW_MESSAGE_TO_SEND_EVENT

public static final nl.tudelft.simulation.event.EventType NEW_MESSAGE_TO_SEND_EVENT
The event to indicate there is a message ready to be sent


queue

protected MessageQueueInterface queue
The queue to store the messages in

Constructor Detail

QueuingSendingDevice

public QueuingSendingDevice(java.lang.String name,
                            DeviceType deviceType,
                            MessageQueueInterface queue)
constructs a new sending device with a message queue, override the default transmission delay and frequency from the DeviceType.

Parameters:
name - the name or description of the device
deviceType - the type of device
queue - the type of queue to store the messages in

QueuingSendingDevice

public QueuingSendingDevice(java.lang.String name,
                            DeviceType deviceType,
                            int transmissionDelay,
                            double transmissionFrequency,
                            MessageQueueInterface queue)
constructs a new sending device with a message queue, override the default transmission delay and frequency from the DeviceType.

Parameters:
name - the name or description of the device
deviceType - the type of device
transmissionDelay - the default logarithmic transmission delay of the device.
transmissionFrequency - the maximum transmission frequency of the device.
queue - the type of queue to store the messages in
Method Detail

send

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

Specified by:
send in interface SendingDeviceInterface
Specified by:
send in class SendingDevice
See Also:
SendingDeviceInterface.send(nl.tudelft.simulation.messaging.Message)


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