@Test public void onDisconnectFailure() { final Connector connector = createConnector(); safeAction( () -> connector.setState( ConnectorState.CONNECTING ) ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.CONNECTING ); pauseScheduler(); connector.onDisconnectFailure(); assertEquals( connector.getState(), ConnectorState.ERROR ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.ERROR ); }
@Action void onDisconnectFailure() { setState( ConnectorState.ERROR ); doSetConnection( null ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectFailureEvent( getSchema().getId(), getSchema().getName() ) ); } }
Connector extends ReplicantService { @Action void onDisconnectFailure() { setState( ConnectorState.ERROR ); doSetConnection( null ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectFailureEvent( getSchema().getId(), getSchema().getName() ) ); } } }
Connector extends ReplicantService { @Action void onDisconnectFailure() { setState( ConnectorState.ERROR ); doSetConnection( null ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectFailureEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action void onDisconnectFailure() { setState( ConnectorState.ERROR ); doSetConnection( null ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectFailureEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { @Action void onDisconnectFailure() { setState( ConnectorState.ERROR ); doSetConnection( null ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectFailureEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }