public class BusConfiguration extends Object
Feature.
Each bus will look for the features it requires and configure them according to the provided configuration.
If a required feature is not found the bus will publish a ConfigurationError
to the ConfigurationErrorHandler| Modifier and Type | Class and Description |
|---|---|
class |
BusConfiguration.Properties
A collection of properties commonly used by different parts of the library.
|
| Constructor and Description |
|---|
BusConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
BusConfiguration |
addFeature(Feature feature)
Add a feature to the given configuration, replacing any existing feature of the same type.
|
BusConfiguration |
addPublicationErrorHandler(IPublicationErrorHandler handler)
Add a handler that will be called whenever a publication error occurs.
|
<T extends Feature> |
getFeature(Class<T> feature)
Get a registered feature by its type (class).
|
<T> T |
getProperty(String name,
T defaultValue)
Read a property from this configuration.
|
Collection<IPublicationErrorHandler> |
getRegisteredPublicationErrorHandlers()
Get an unmodifiable collection of all registered publication error handlers
|
boolean |
hasProperty(String name)
Check whether a property has been set.
|
BusConfiguration |
setProperty(String name,
Object value)
Set a property which will be read by the message bus constructor.
|
public BusConfiguration setProperty(String name, Object value)
true even if set to null).name - The name of the property. Note: Each implementation may support different properties.value - The value of the property.this bus configuration.public <T> T getProperty(String name, T defaultValue)
T - The type of propertyname - The name of the property to be read.defaultValue - The value to be returned if property was not founddefaultValue if not presentpublic boolean hasProperty(String name)
public <T extends Feature> T getFeature(Class<T> feature)
public BusConfiguration addFeature(Feature feature)
feature - The feature to addthis bus configuration.public final BusConfiguration addPublicationErrorHandler(IPublicationErrorHandler handler)
PublicationErrorhandler - The handler to be added to the list of handlersthis bus configuration.public Collection<IPublicationErrorHandler> getRegisteredPublicationErrorHandlers()
Copyright © 2018. All rights reserved.