示例#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()));
 }