/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public <T> T getConnectorValue() { return (T) getConnecteeValue(); }
/** * Notifies its listeners about a change in the connector's value. */ protected void fireConnectorValueChange() { try { fireValueChange(createChangeEvent(oldConnectorValue, getConnecteeValue())); } catch (RuntimeException ex) { try { propagateRollback(); } catch (Exception ex2) { // ignore. Nothing can be done about it. } throw ex; } // the change propagated correctly. Save the value propagated as the old // value of the connector. oldConnectorValue = computeOldConnectorValue(getConnecteeValue()); }
/** * Whenever an exception occurs when setting a connector value, some * notifications have to be fired to notify listeners. */ protected void propagateRollback() { Object badValue = getConnectorValue(); setConnecteeValue(oldConnectorValue); // propagate the reverse change... fireValueChange(createChangeEvent(badValue, getConnecteeValue())); }
|| !ObjectUtils.equals(actualValue, computeOldConnectorValue(getConnecteeValue()))) { setConnecteeValue(actualValue); fireConnectorValueChange();