Commit d7e3b30e by Johannes Edmeier

Remove RoutesOutdatedEvent

parent 62161663
......@@ -15,9 +15,6 @@
*/
package de.codecentric.boot.admin.server.config;
import de.codecentric.boot.admin.server.event.ClientApplicationDeregisteredEvent;
import de.codecentric.boot.admin.server.event.ClientApplicationRegisteredEvent;
import de.codecentric.boot.admin.server.event.RoutesOutdatedEvent;
import de.codecentric.boot.admin.server.journal.ApplicationEventJournal;
import de.codecentric.boot.admin.server.journal.web.JournalController;
import de.codecentric.boot.admin.server.registry.ApplicationRegistry;
......@@ -33,7 +30,6 @@ import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
......@@ -98,14 +94,4 @@ public class AdminServerWebConfiguration implements WebMvcConfigurer, Applicatio
return new JournalController(applicationEventJournal);
}
@EventListener
public void onClientApplicationRegistered(ClientApplicationRegisteredEvent event) {
publisher.publishEvent(new RoutesOutdatedEvent());
}
@EventListener
public void onClientApplicationDeregistered(ClientApplicationDeregisteredEvent event) {
publisher.publishEvent(new RoutesOutdatedEvent());
}
}
......@@ -16,7 +16,6 @@
package de.codecentric.boot.admin.server.config;
import de.codecentric.boot.admin.server.event.ClientApplicationEvent;
import de.codecentric.boot.admin.server.event.RoutesOutdatedEvent;
import de.codecentric.boot.admin.server.journal.store.HazelcastJournaledEventStore;
import de.codecentric.boot.admin.server.journal.store.JournaledEventStore;
import de.codecentric.boot.admin.server.model.Application;
......@@ -34,14 +33,9 @@ import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfigurati
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.hazelcast.core.EntryAdapter;
import com.hazelcast.core.EntryEvent;
import com.hazelcast.core.EntryListener;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IList;
import com.hazelcast.core.IMap;
import com.hazelcast.core.MapEvent;
import com.hazelcast.map.listener.MapListener;
@Configuration
@ConditionalOnSingleCandidate(HazelcastInstance.class)
......@@ -66,7 +60,6 @@ public class HazelcastStoreConfiguration {
public ApplicationStore applicationStore() {
IMap<String, Application> map = hazelcastInstance.getMap(hazelcastMapName);
map.addIndex("name", false);
map.addEntryListener((MapListener) entryListener(), false);
return new HazelcastApplicationStore(map);
}
......@@ -77,18 +70,4 @@ public class HazelcastStoreConfiguration {
return new HazelcastJournaledEventStore(list);
}
@Bean
public EntryListener<String, Application> entryListener() {
return new EntryAdapter<String, Application>() {
@Override
public void onEntryEvent(EntryEvent<String, Application> event) {
publisher.publishEvent(new RoutesOutdatedEvent());
}
@Override
public void onMapEvent(MapEvent event) {
publisher.publishEvent(new RoutesOutdatedEvent());
}
};
}
}
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.codecentric.boot.admin.server.event;
import java.io.Serializable;
/**
* Signals that the routes needs to be recalculated.
*
* @author Johannes Edmeier
*/
public class RoutesOutdatedEvent implements Serializable {
private static final long serialVersionUID = 1L;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment