@Test public void disconnectIfPossible() { final Connector connector = createConnector(); newConnection( connector ); safeAction( () -> connector.setState( ConnectorState.CONNECTED ) ); safeAction( connector::disconnectIfPossible ); assertEquals( connector.getState(), ConnectorState.DISCONNECTING ); }
void disconnectIfPossible() { if ( !ConnectorState.isTransitionState( getState() ) ) { if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new RestartEvent( getSchema().getId(), getSchema().getName() ) ); } disconnect(); } }
Connector extends ReplicantService { void disconnectIfPossible() { if ( !ConnectorState.isTransitionState( getState() ) ) { if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new RestartEvent( getSchema().getId(), getSchema().getName() ) ); } disconnect(); } } }
Connector extends ReplicantService { void disconnectIfPossible() { if ( !ConnectorState.isTransitionState( getState() ) ) { if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new RestartEvent( getSchema().getId(), getSchema().getName() ) ); } disconnect(); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { void disconnectIfPossible() { if ( !ConnectorState.isTransitionState( getState() ) ) { if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new RestartEvent( getSchema().getId(), getSchema().getName() ) ); } disconnect(); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { void disconnectIfPossible() { if ( !ConnectorState.isTransitionState( getState() ) ) { if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new RestartEvent( getSchema().getId(), getSchema().getName() ) ); } disconnect(); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }