}
@Override
public void notify(EventObject event) throws Exception {
if (event instanceof RouteAddedEvent) {
RouteAddedEvent rse = (RouteAddedEvent) event;
Endpoint endpoint = rse.getRoute().getEndpoint();
String routeId = rse.getRoute().getId();
// a HashSet is fine for inputs as we only have a limited number of those
Set<String> uris = new HashSet<String>();
uris.add(endpoint.getEndpointUri());
inputs.put(routeId, uris);
// use a LRUCache for outputs as we could potential have unlimited uris if dynamic routing is in use
// and therefore need to have the limit in use
outputs.put(routeId, new LRUCache<String, String>(limit));
} else if (event instanceof RouteRemovedEvent) {
RouteRemovedEvent rse = (RouteRemovedEvent) event;
String routeId = rse.getRoute().getId();
inputs.remove(routeId);
outputs.remove(routeId);
} else {
ExchangeSendingEvent ese = (ExchangeSendingEvent) event;
Endpoint endpoint = ese.getEndpoint();