/** * Start domain mapping event receiver thread. * * @param executorService executor service instance * @param topologyProvider topology receiver instance */ private void startDomainMappingEventReceiver( ExecutorService executorService, TopologyProvider topologyProvider) { // Enforcing the listener order in order execute extension listener later domainMappingEventReceiver = new LoadBalancerCommonDomainMappingEventReceiver(topologyProvider, false); // Add extension event listeners addDomainMappingsEventListeners(domainMappingEventReceiver); // Add default domain mapping event listeners domainMappingEventReceiver.addEventListeners(); domainMappingEventReceiver.setExecutorService(executorService); domainMappingEventReceiver.execute(); if (log.isInfoEnabled()) { log.info("Domain mapping event receiver thread started"); } }
private void addDomainMappingsEventListeners( final LoadBalancerCommonDomainMappingEventReceiver domainMappingEventReceiver) { domainMappingEventReceiver.addEventListener( new DomainMappingAddedEventListener() { @Override protected void onEvent(Event event) { reloadConfiguration(); } }); domainMappingEventReceiver.addEventListener( new DomainMappingRemovedEventListener() { @Override protected void onEvent(Event event) { reloadConfiguration(); } }); }