@Override public Collection<StateVariableValue> getCurrentState() throws Exception { lock(); try { Collection<StateVariableValue> values = readInitialEventedStateVariableValues(); if (values != null) { log.fine("Obtained initial state variable values for event, skipping individual state variable accessors"); return values; } values = new ArrayList<>(); for (StateVariable stateVariable : getService().getStateVariables()) { if (stateVariable.getEventDetails().isSendEvents()) { StateVariableAccessor accessor = getService().getAccessor(stateVariable); if (accessor == null) throw new IllegalStateException("No accessor for evented state variable"); values.add(accessor.read(stateVariable, getImplementation())); } } return values; } finally { unlock(); } }
@Override public Collection<StateVariableValue> getCurrentState() throws Exception { lock(); try { Collection<StateVariableValue> values = readInitialEventedStateVariableValues(); if (values != null) { log.fine("Obtained initial state variable values for event, skipping individual state variable accessors"); return values; } values = new ArrayList(); for (StateVariable stateVariable : getService().getStateVariables()) { if (stateVariable.getEventDetails().isSendEvents()) { StateVariableAccessor accessor = getService().getAccessor(stateVariable); if (accessor == null) throw new IllegalStateException("No accessor for evented state variable"); values.add(accessor.read(stateVariable, getImplementation())); } } return values; } finally { unlock(); } }
@Override public Collection<StateVariableValue> getCurrentState() throws Exception { lock(); try { Collection<StateVariableValue> values = readInitialEventedStateVariableValues(); if (values != null) { log.fine("Obtained initial state variable values for event, skipping individual state variable accessors"); return values; } values = new ArrayList<>(); for (StateVariable stateVariable : getService().getStateVariables()) { if (stateVariable.getEventDetails().isSendEvents()) { StateVariableAccessor accessor = getService().getAccessor(stateVariable); if (accessor == null) throw new IllegalStateException("No accessor for evented state variable"); values.add(accessor.read(stateVariable, getImplementation())); } } return values; } finally { unlock(); } }