- All Known Implementing Classes:
BusBuilderImpl
public interface BusBuilder
Class used to build
event buses.-
Method Summary
Modifier and TypeMethodDescriptionAllow callingIEventBus.post(EventPriority, Event).build()Returns a built bus configured according to the configuration of this builder.static BusBuilderbuilder()Returns a new bus builder.Make the bus check posted events using theclass checker.classChecker(IEventClassChecker checker) Set a class checker that will allow validating the event types that the bus can handle.default BusBuildermarkerType(Class<?> markerInterface) Helper forclassChecker(IEventClassChecker)that will check if the event type is of the givenmarkerInterface.Override the default exception handler.Create the bus in a shut down state.
-
Method Details
-
builder
Returns a new bus builder.- Returns:
- a new bus builder
-
setExceptionHandler
Override the default exception handler.- Parameters:
handler- the custom exception handler to use- Returns:
- the builder instance
-
startShutdown
BusBuilder startShutdown()Create the bus in a shut down state.This bus will not post events (and will instead silently ignore them) until it is
started.- Returns:
- the builder instance
-
checkTypesOnDispatch
BusBuilder checkTypesOnDispatch()Make the bus check posted events using theclass checker.- Returns:
- the builder instance
-
markerType
Helper forclassChecker(IEventClassChecker)that will check if the event type is of the givenmarkerInterface.- Parameters:
markerInterface- a base marker interface for all events that this bus should be able to handle- Returns:
- the builder instance
-
classChecker
Set a class checker that will allow validating the event types that the bus can handle.- Parameters:
checker- the custom checker- Returns:
- the builder instance
-
allowPerPhasePost
BusBuilder allowPerPhasePost()Allow callingIEventBus.post(EventPriority, Event). -
build
IEventBus build()Returns a built bus configured according to the configuration of this builder.- Returns:
- a built bus configured according to the configuration of this builder
-