예제 #1
0
  /** {@inheritDoc} */
  public void operational(final ConnectionEvent e) {
    // ... forward the new connection state
    doForwardConnectionStateChange(ConnectionState.translate(e.getState()));

    // ... forward initial values
    updateCharacteristicListeners();
  }
예제 #2
0
  /**
   * Sets the DAL property, this connector is connected to.
   *
   * @param dalProperty the DAL property
   */
  private void setDalProperty(DynamicValueProperty dalProperty) {
    if (_dalProperty != null) {
      _dalProperty.removeDynamicValueListener(this);
      _dalProperty.removePropertyChangeListener(this);
      _dalProperty.removeLinkListener(this);
    }

    _dalProperty = dalProperty;

    if (_dalProperty != null) {
      _dalProperty.addDynamicValueListener(this);

      _dalProperty.addPropertyChangeListener(this);

      // we add a LinkListener to get informed of connection state changes
      _dalProperty.addLinkListener(this);

      // send initial connection state
      forwardConnectionState(ConnectionState.translate(_dalProperty.getConnectionState()));
    }
  }
예제 #3
0
 private void forwardConnectionEvent(ConnectionEvent e) {
   doForwardConnectionStateChange(ConnectionState.translate(e.getState()));
 }
예제 #4
0
 /** {@inheritDoc} */
 public void connectionFailed(ConnectionEvent e) {
   doForwardConnectionStateChange(ConnectionState.translate(e.getState()));
 }