@Test public void testListenersAreNotNotifiedWhenNoNewVersions() { service.addListener(listener); assertTrue("No notification when no new versions", listener.notifiedEvents.size() == 0); }
public void addListener(UpdateCheckListener newListener) { GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } newListener.setUpdateCheckService(this); listeners.add(newListener); }
UpdateCheckService implements Service { public void addListener(UpdateCheckListener newListener) { GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } newListener.setUpdateCheckService(this); listeners.add(newListener); } }
UpdateCheckService implements Service { public void addListener(UpdateCheckListener newListener) { GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } newListener.setUpdateCheckService(this); listeners.add(newListener); } UpdateCheckService(); }
UpdateCheckService implements Service { public void addListener(UpdateCheckListener newListener) { GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } newListener.setUpdateCheckService(this); listeners.add(newListener); } UpdateCheckService(); @Resource(name = "schedulerProvider") void setSchedulerProvider(SchedulerProvider provider); @Override String getType(); @Override void init(ServiceContext serviceContext); @Override void start(); @Override void stop(); @Override void quiesce(); @Override void destroy(); void checkForUpdate(UpdateCheckListener updateCheckListener); void addListener(UpdateCheckListener newListener); }
UpdateCheckService implements Service { public void addListener(UpdateCheckListener newListener) { GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } newListener.setUpdateCheckService(this); listeners.add(newListener); } UpdateCheckService(); @Resource(name = "schedulerProvider") void setSchedulerProvider(SchedulerProvider provider); @Override String getType(); @Override void init(ServiceContext serviceContext); @Override void start(); @Override void stop(); @Override void quiesce(); @Override void destroy(); void checkForUpdate(UpdateCheckListener updateCheckListener); void addListener(UpdateCheckListener newListener); static String MANAGEMENT_UPDATE_CHECK_LISTENER; }