@Test public void assertConnectionLostListenerWhenConnectionStateIsLostButIsShutdown() { regCenterConnectionStateListener.stateChanged(null, ConnectionState.LOST); verify(jobScheduleController, times(0)).pauseJob(); verify(jobScheduleController, times(0)).resumeJob(); }
@Override public void stateChanged(final CuratorFramework client, final ConnectionState newState) { if (JobRegistry.getInstance().isShutdown(jobName)) { return; } JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName); if (ConnectionState.SUSPENDED == newState || ConnectionState.LOST == newState) { jobScheduleController.pauseJob(); } else if (ConnectionState.RECONNECTED == newState) { serverService.persistOnline(serverService.isEnableServer(JobRegistry.getInstance().getJobInstance(jobName).getIp())); instanceService.persistOnline(); executionService.clearRunningInfo(shardingService.getLocalShardingItems()); jobScheduleController.resumeJob(); } }
RegistryCenterConnectionStateListener implements ConnectionStateListener { @Override public void stateChanged(final CuratorFramework client, final ConnectionState newState) { if (JobRegistry.getInstance().isShutdown(jobName)) { return; } JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName); if (ConnectionState.SUSPENDED == newState || ConnectionState.LOST == newState) { jobScheduleController.pauseJob(); } else if (ConnectionState.RECONNECTED == newState) { serverService.persistOnline(serverService.isEnableServer(JobRegistry.getInstance().getJobInstance(jobName).getIp())); instanceService.persistOnline(); executionService.clearRunningInfo(shardingService.getLocalShardingItems()); jobScheduleController.resumeJob(); } } }
RegistryCenterConnectionStateListener implements ConnectionStateListener { @Override public void stateChanged(final CuratorFramework client, final ConnectionState newState) { if (JobRegistry.getInstance().isShutdown(jobName)) { return; } JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName); if (ConnectionState.SUSPENDED == newState || ConnectionState.LOST == newState) { jobScheduleController.pauseJob(); } else if (ConnectionState.RECONNECTED == newState) { serverService.persistOnline(serverService.isEnableServer(JobRegistry.getInstance().getJobInstance(jobName).getIp())); instanceService.persistOnline(); executionService.clearRunningInfo(shardingService.getLocalShardingItems()); jobScheduleController.resumeJob(); } } RegistryCenterConnectionStateListener(final CoordinatorRegistryCenter regCenter, final String jobName); }
RegistryCenterConnectionStateListener implements ConnectionStateListener { @Override public void stateChanged(final CuratorFramework client, final ConnectionState newState) { if (JobRegistry.getInstance().isShutdown(jobName)) { return; } JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName); if (ConnectionState.SUSPENDED == newState || ConnectionState.LOST == newState) { jobScheduleController.pauseJob(); } else if (ConnectionState.RECONNECTED == newState) { serverService.persistOnline(serverService.isEnableServer(JobRegistry.getInstance().getJobInstance(jobName).getIp())); instanceService.persistOnline(); executionService.clearRunningInfo(shardingService.getLocalShardingItems()); jobScheduleController.resumeJob(); } } RegistryCenterConnectionStateListener(final CoordinatorRegistryCenter regCenter, final String jobName); @Override void stateChanged(final CuratorFramework client, final ConnectionState newState); }
RegistryCenterConnectionStateListener implements ConnectionStateListener { @Override public void stateChanged(final CuratorFramework client, final ConnectionState newState) { if (JobRegistry.getInstance().isShutdown(jobName)) { return; } JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName); if (ConnectionState.SUSPENDED == newState || ConnectionState.LOST == newState) { jobScheduleController.pauseJob(); } else if (ConnectionState.RECONNECTED == newState) { serverService.persistOnline(serverService.isEnableServer(JobRegistry.getInstance().getJobInstance(jobName).getIp())); instanceService.persistOnline(); executionService.clearRunningInfo(shardingService.getLocalShardingItems()); jobScheduleController.resumeJob(); } } RegistryCenterConnectionStateListener(final CoordinatorRegistryCenter regCenter, final String jobName); @Override void stateChanged(final CuratorFramework client, final ConnectionState newState);  }