aa4mm.basic.coupling.artefacts_ports
Class OutputPort<O extends SimulData>

java.lang.Object
  extended by aa4mm.basic.coupling.artefacts_ports.OutputPort<O>
Type Parameters:
O -
All Implemented Interfaces:
JmsPort

public abstract class OutputPort<O extends SimulData>
extends java.lang.Object
implements JmsPort

Since:
Darjeeling
Author:
Julien Siebert

Field Summary
protected  java.lang.Class classO
           
protected  jmsOutput<O> jmsOutputBinding
           
protected  javax.jms.ObjectMessage lastReadData
          Last data read by the coupling artefact.
 
Constructor Summary
OutputPort(java.lang.Class<O> ObjectClassToReadFromJms, java.lang.String NameOfOutputPortFromJms)
           
 
Method Summary
 java.lang.Class getClassO()
           
 javax.jms.ObjectMessage read(SimulTime currentSimulationTime)
          Read a message from the JMS topic.
private  javax.jms.ObjectMessage readFromJMS(double ct)
          This method, reads a message from JMS and checks if the properties fullfil the guard condition which is
current <= Current Simulator Time AND Current Simulator Time < next
 javax.jms.ObjectMessage readInitialValue(SimulTime initialSimulationTime)
          TODO faire quelquechose concernant ce code qui porrait être factorisé avec la fonction d'en dessous: la première fois que l'on lit une donnée depuis la mémoire partagée, le simulateur n'a pas encore été lancé.
protected  void setLastReadData(javax.jms.ObjectMessage inMsg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface aa4mm.basic.coupling.artefacts_ports.JmsPort
init, setJMSConnexionParameters
 

Field Detail

lastReadData

protected javax.jms.ObjectMessage lastReadData
Last data read by the coupling artefact. It is needed in order to implement the coordination model.


jmsOutputBinding

protected jmsOutput<O extends SimulData> jmsOutputBinding

classO

protected java.lang.Class classO
Constructor Detail

OutputPort

public OutputPort(java.lang.Class<O> ObjectClassToReadFromJms,
                  java.lang.String NameOfOutputPortFromJms)
Method Detail

readInitialValue

public javax.jms.ObjectMessage readInitialValue(SimulTime initialSimulationTime)
                                         throws javax.jms.JMSException
TODO faire quelquechose concernant ce code qui porrait être factorisé avec la fonction d'en dessous: la première fois que l'on lit une donnée depuis la mémoire partagée, le simulateur n'a pas encore été lancé. donc il faut trouver la donnée qui correspond a ct = "current"

Throws:
javax.jms.JMSException

read

public javax.jms.ObjectMessage read(SimulTime currentSimulationTime)
                             throws javax.jms.JMSException
Read a message from the JMS topic. We need a guard condition in order to deal with simulators coordination

Returns:
ObjectMessage inMsg : The JMS message received
Throws:
javax.jms.JMSException

readFromJMS

private javax.jms.ObjectMessage readFromJMS(double ct)
                                     throws javax.jms.JMSException
This method, reads a message from JMS and checks if the properties fullfil the guard condition which is
current <= Current Simulator Time AND Current Simulator Time < next

Returns:
A valid simula data from JMS that fulfill the guard condition
Throws:
javax.jms.JMSException - TODO this is the run state function do the init state function

setLastReadData

protected void setLastReadData(javax.jms.ObjectMessage inMsg)

getClassO

public java.lang.Class getClassO()