Package net.engio.mbassy.bus.config
Class BusConfiguration
java.lang.Object
net.engio.mbassy.bus.config.BusConfiguration
- All Implemented Interfaces:
IBusConfiguration
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.engio.mbassy.bus.config.IBusConfiguration
IBusConfiguration.Properties
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFeature
(Feature feature) Add a feature to the given configuration, replacing any existing feature of the same type.final BusConfiguration
Add a handler that will be called whenever a publication error occurs.<T extends Feature>
TgetFeature
(Class<T> feature) Get a registered feature by its type (class).<T> T
getProperty
(String name, T defaultValue) Read a property from this configuration.Get an unmodifiable collection of all registered publication error handlersboolean
hasProperty
(String name) Check whether a property has been set.setProperty
(String name, Object value) Set a property which will be read by the message bus constructor.
-
Field Details
-
properties
-
publicationErrorHandlers
-
-
Constructor Details
-
BusConfiguration
public BusConfiguration()
-
-
Method Details
-
setProperty
Description copied from interface:IBusConfiguration
Set a property which will be read by the message bus constructor. Existing value will be overwritten. Null values are supported (checking for existence of property will returntrue
even if set tonull
).- Specified by:
setProperty
in interfaceIBusConfiguration
- Parameters:
name
- The name of the property. Note: Each implementation may support different properties.value
- The value of the property.- Returns:
- A reference to
this
bus configuration.
-
getProperty
Description copied from interface:IBusConfiguration
Read a property from this configuration.- Specified by:
getProperty
in interfaceIBusConfiguration
- Type Parameters:
T
- The type of property- Parameters:
name
- The name of the property to be read.defaultValue
- The value to be returned if property was not found- Returns:
- The value associated with the given property name or
defaultValue
if not present
-
hasProperty
Description copied from interface:IBusConfiguration
Check whether a property has been set.- Specified by:
hasProperty
in interfaceIBusConfiguration
- Returns:
- true if property was set (even if set to null) false otherwise
-
getFeature
Description copied from interface:IBusConfiguration
Get a registered feature by its type (class).- Specified by:
getFeature
in interfaceIBusConfiguration
-
addFeature
Description copied from interface:IBusConfiguration
Add a feature to the given configuration, replacing any existing feature of the same type.- Specified by:
addFeature
in interfaceIBusConfiguration
- Parameters:
feature
- The feature to add- Returns:
- A reference to
this
bus configuration.
-
addPublicationErrorHandler
Description copied from interface:IBusConfiguration
Add a handler that will be called whenever a publication error occurs. SeePublicationError
- Specified by:
addPublicationErrorHandler
in interfaceIBusConfiguration
- Parameters:
handler
- The handler to be added to the list of handlers- Returns:
- A reference to
this
bus configuration.
-
getRegisteredPublicationErrorHandlers
Description copied from interface:IBusConfiguration
Get an unmodifiable collection of all registered publication error handlers- Specified by:
getRegisteredPublicationErrorHandlers
in interfaceIBusConfiguration
-