reactor.bus.spec.EventRoutingComponentSpec Maven / Gradle / Ivy
/*
* Copyright (c) 2011-2014 Pivotal Software, Inc.
*
* 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 reactor.bus.spec;
import reactor.Environment;
import reactor.bus.Event;
import reactor.bus.EventBus;
import reactor.bus.filter.*;
import reactor.bus.registry.Registries;
import reactor.bus.registry.Registry;
import reactor.bus.routing.ConsumerFilteringRouter;
import reactor.bus.routing.Router;
import reactor.bus.routing.TraceableDelegatingRouter;
import reactor.core.Dispatcher;
import reactor.core.dispatch.TraceableDelegatingDispatcher;
import reactor.core.support.Assert;
import reactor.fn.Consumer;
/**
* A generic environment-aware class for specifying components that need to be configured with an {@link Environment},
* {@link Dispatcher}, and {@link reactor.bus.routing.Router}.
*
* @param
* The DispatcherComponentSpec subclass
* @param
* The type that this spec will create
*
* @author Jon Brisbin
*/
@SuppressWarnings("unchecked")
public abstract class EventRoutingComponentSpec, TARGET> extends
DispatcherComponentSpec {
private EventRoutingStrategy eventRoutingStrategy;
private Router router;
private Filter eventFilter;
private Consumer dispatchErrorHandler;
private Consumer uncaughtErrorHandler;
private Registry