@Override public void publishEvent(Object event) { if (event instanceof BrokerAvailabilityEvent) { this.availabilityEvents.add(((BrokerAvailabilityEvent) event).isBrokerAvailable()); } } }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { if (event.isBrokerAvailable()) { long delay = getRegistryExpirationPeriod() / 2; this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(this.schedulerTask, delay); } else { ScheduledFuture<?> future = this.scheduledFuture; if (future != null ){ future.cancel(true); this.scheduledFuture = null; } } }
public void expectBrokerAvailabilityEvent(boolean isBrokerAvailable) throws InterruptedException { BrokerAvailabilityEvent event = this.eventQueue.poll(20000, TimeUnit.MILLISECONDS); assertNotNull("Times out waiting for BrokerAvailabilityEvent[" + isBrokerAvailable + "]", event); assertEquals(isBrokerAvailable, event.isBrokerAvailable()); } }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { if (event.isBrokerAvailable()) { long delay = getRegistryExpirationPeriod() / 2; this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(this.schedulerTask, delay); } else { ScheduledFuture<?> future = this.scheduledFuture; if (future != null ){ future.cancel(true); this.scheduledFuture = null; } } }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { this.brokerAvailable.set(event.isBrokerAvailable()); }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { this.brokerAvailable.set(event.isBrokerAvailable()); }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { if (event.isBrokerAvailable()) { long delay = getRegistryExpirationPeriod() / 2; this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(this.schedulerTask, delay); } else { ScheduledFuture<?> future = this.scheduledFuture; if (future != null ){ future.cancel(true); this.scheduledFuture = null; } } }
@Override public void onApplicationEvent(BrokerAvailabilityEvent event) { if (event.isBrokerAvailable()) { long delay = getRegistryExpirationPeriod() / 2; this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(this.schedulerTask, delay); } else { ScheduledFuture<?> future = this.scheduledFuture; if (future != null ){ future.cancel(true); this.scheduledFuture = null; } } }