Пример #1
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);
  }
Пример #2
0
  public void getUMLreceive(TypedCircularMessage message, long ts) {
    UmlReceive umlReceive = new UmlReceive(message);

    MentorIndex index = blackbox.getMentorIndex();
    long receiverClassId = umlReceive.getReceiverClassId();
    String receiverClassName = index.getClazz((int) receiverClassId);
    if (receiverClassName == null) {
      receiverClassName = "UnknownClassName";
    }

    final UmlStateMachine machine = getStatemachineByName(receiverClassName);

    SRLReceive receive = new SRLReceive();

    receive.setReceiverId(machine.getId());
    receive.setReceiverInstance(umlReceive.getReceiverInstanceId());
    receive.setReceiverReplicationIndex(0);

    long stateId = umlReceive.getNextStateId();
    String stateName = index.getState((int) stateId);
    UmlState umlState = getStateByName(stateName, machine);
    receive.setStateId(umlState.getId());

    long signalId = umlReceive.getSignalId();
    String signalName = index.getSignal((int) signalId);
    receive.setSignal(signalName);
    Long signalInstanceId = umlReceive.getSignalInstanceId();
    receive.setMessageAddress(signalInstanceId);
    Long sentAt = getSentAt(signalInstanceId);
    receive.setSentAt(sentAt);

    receive.setPort("");
    receive.setPortIndex(Long.valueOf(0));

    final long high = umlReceive.getFinishHi();
    final long low = umlReceive.getFinishLo();

    long finishTime = resolveTimeStamp((high << 32) + low);
    finishTime = convertTime(finishTime);
    receive.setTs(finishTime);

    getSRLReceive(receive, ts);

    return;
  }