/** * Destroys this destination. * * <p>If the connection state is connected, it will be disconnected. The connection state is set * to {@link #DESTROYED}. The associated transport layer is notified through {@link * TransportLayer#destroyDestination(Destination)}. <br> * On an already destroyed destination, no action is performed. */ public synchronized void destroy() { if (state == DESTROYED) return; if (state != DISCONNECTED) try { tl.disconnect(this); } catch (final KNXLinkClosedException e) { // we already should've been destroyed on catching this exception } setState(DESTROYED); tl.destroyDestination(this); }
/** * Sets a new destination connection state. * * <p>If necessary, the connection timeout for the destination is started, restarted or * deactivated according the state transition.<br> * If the state of destination is {@link Destination#DESTROYED}, setting of a new state is * ignored. * * @param newState new destination state */ public void setState(byte newState) { d.setState(newState); }