예제 #1
0
  private void getRoseSend(TypedCircularMessage message, long receivedAt, long ts) {
    final UmlStateMachine sendMachine =
        getStatemachineByName(getValue(message, SRLEventReader.FN_SENDER_ACTOR).toString());
    final UmlStateMachine receiveMachine =
        getStatemachineByName(
            getValue(message, SRLEventReader.FN_RECEIVER_ACTOR.toString()).toString());
    final Long msgAddr = (Long) getValue(message, SRLEventReader.FN_MSG_ADDR);

    SRLSend srlSendEvent = new SRLSend();

    srlSendEvent.setSenderId(sendMachine.getId());
    srlSendEvent.setSenderInstance(
        ((Long) getValue(message, SRLEventReader.FN_SENDER_ACTOR_INSTANCE)).intValue());
    srlSendEvent.setSenderReplicatioIndex(
        ((Long) getValue(message, SRLEventReader.FN_SENDER_REPLICATION_INDEX)).intValue());
    srlSendEvent.setReceiverId(receiveMachine.getId());
    srlSendEvent.setReceiverInstance(
        ((Long) getValue(message, SRLEventReader.FN_RECEIVER_ACTOR_INSTANCE)).intValue());
    srlSendEvent.setReceiverReplicationIndex(
        ((Long) getValue(message, SRLEventReader.FN_RECEIVER_REPLICATION_INDEX)).intValue());
    srlSendEvent.setSignal(getValue(message, SRLEventReader.FN_SIGNAL).toString());
    srlSendEvent.setPort(getValue(message, SRLEventReader.FN_PORT).toString());
    srlSendEvent.setPortIndex((Long) getValue(message, SRLEventReader.FN_PORT_INDEX));
    srlSendEvent.setMessageAddress(msgAddr);
    srlSendEvent.setReceivedAt(resolveTimeStamp(receivedAt));
    srlSendEvent.setTs(resolveTimeStamp(((CircularMessage) message.getMessage()).getTs()));

    getSRLSend(srlSendEvent, ts);
  }
예제 #2
0
 private void getSRLSend(SRLSend send, long ts) {
   FieldValues values = new FieldValues();
   // addProcess(event.getSenderProcess());
   // addProcess(event.getAddresseeProcess());
   values.addIntValue(send.getSenderInstance());
   values.addStringValue(send.getPort());
   values.addIntValue(send.getPortIndex().intValue());
   values.addIntValue(send.getMessageAddress().intValue());
   sentTsByMsgAddr.put(send.getMessageAddress(), send.getTs());
   client.eventRead(
       new RoseSendEventInfo(
           ts,
           send.getSenderId(),
           send.getReceiverId(),
           send.getReceivedAt(),
           send.getSignal(),
           send.getReceiverInstance(),
           EventFactory.ROSE_SEND_EVENT_TYPE_ID,
           values));
 }
예제 #3
0
  public void getUMLSend(TypedCircularMessage message, long receivedAt, long ts) {

    UmlSend umlSend = new UmlSend(message);

    MentorIndex mentorIndex = blackbox.getMentorIndex();

    long senderClassId = umlSend.getSenderClassId();
    String senderStateMachine = mentorIndex.getClazz((int) senderClassId);
    final UmlStateMachine sendMachine = getStatemachineByName(senderStateMachine);

    long receiverClassId = umlSend.getReceiverClassId();
    String receiverStateMachine = mentorIndex.getClazz((int) receiverClassId);
    final UmlStateMachine receiveMachine = getStatemachineByName(receiverStateMachine);

    SRLSend srlSendEvent = new SRLSend();

    srlSendEvent.setSenderId(sendMachine.getId());
    srlSendEvent.setSenderInstance((int) umlSend.getSenderInstanceId());
    srlSendEvent.setSenderReplicatioIndex(0);
    srlSendEvent.setReceiverId(receiveMachine.getId());
    srlSendEvent.setReceiverInstance((int) umlSend.getReceiverInstanceId());
    srlSendEvent.setReceiverReplicationIndex(0);

    long signalId = umlSend.getSignalId();
    String signal = mentorIndex.getSignal((int) signalId);
    srlSendEvent.setSignal(signal);
    srlSendEvent.setMessageAddress(umlSend.getSignalInstanceId());
    srlSendEvent.setPort("");
    srlSendEvent.setPortIndex(Long.valueOf(0));
    srlSendEvent.setReceivedAt(resolveTimeStamp(receivedAt));
    srlSendEvent.setTs(resolveTimeStamp(((CircularMessage) message.getMessage()).getTs()));
    getSRLSend(srlSendEvent, ts);
  }