@Override public void startCommand(String command, Map<String, String[]> parameters) { if (RunningTraceContainer.isTraceRunning()) throw new RuntimeException("UseCase already running"); String useCaseName = parameters.get(PARAM_USE_CASE_NAME)[0]; if (useCaseName == null || useCaseName.length() == 0) useCaseName = "unnamed" + unnamedCounter.incrementAndGet(); RunningTraceContainer.startTracedCall(useCaseName); LOGGER.info("Starting command: " + useCaseName); }
@Override public void stopCommand(String command, Map<String, String[]> parameters) { LOGGER.info("Stoping command: " + command); TracedCall last = RunningTraceContainer.endTrace(); LOGGER.info("LAST_ " + last); UseCaseRecorderFactory.getUseCaseRecorder().addRecordedUseCase((CurrentlyTracedCall) last); }