예제 #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 read(Blackbox blackbox, boolean dummyRun) {
    this.blackbox = blackbox;
    this.dummyRun = dummyRun;
    taskMap = new LinkedHashMap<Long, Task>();
    try {
      reset();
      preProcessLinear(blackbox.getTypedLinearMessages());
      correctMessageIds(blackbox.getTypedCircularMessages());
      preProcessCircular(blackbox.getTypedCircularMessages());
      preProcessStateMachines();
      preProcessTimeRef(blackbox.getTypedCircularMessages());

      if (dummyRun) {
        return;
      }
      // writeTaskStatsTable();
      getEvents(blackbox.getTypedCircularMessages());
      getTasks();
      getStateMachineMap();
    } finally {
      this.blackbox = null;
    }
  }
예제 #3
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;
  }