@Test public void close() { assertThat(doConnectCalled.get()).isEqualTo(false); assertThat(link.isConnected()).isEqualTo(false); link.connect(); assertThat(doConnectCalled.get()).isEqualTo(true); assertThat(link.isConnected()).isEqualTo(true); link.close(); assertThat(doConnectCalled.get()).isEqualTo(true); assertThat(doDisconnectCalled.get()).isEqualTo(true); assertThat(link.isConnected()).isEqualTo(false); }
@Override public void close() { this.disconnect().join(); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void close() { this.disconnect().join(); } }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void close() { this.disconnect().join(); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void close() { this.disconnect().join(); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); @Override final CompletableFuture<Void> connect(); abstract CompletableFuture<Void> doConnect(); @Override void close(); @Override final CompletableFuture<Void> disconnect(); abstract CompletableFuture<Void> doDisconnect(); @Override boolean isConnected(); @Override void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); @Override void removeLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void close() { this.disconnect().join(); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); @Override final CompletableFuture<Void> connect(); abstract CompletableFuture<Void> doConnect(); @Override void close(); @Override final CompletableFuture<Void> disconnect(); abstract CompletableFuture<Void> doDisconnect(); @Override boolean isConnected(); @Override void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); @Override void removeLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener);  }