Interface IBusConfiguration

  • All Known Implementing Classes:
    BusConfiguration

    public interface IBusConfiguration
    The configuration of message bus instances is feature driven, e.g. configuration parameters are grouped into 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
    • Method Detail

      • setProperty

        IBusConfiguration setProperty​(java.lang.String name,
                                      java.lang.Object value)
        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 return true even if set to null).
        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

        <T> T getProperty​(java.lang.String name,
                          T defaultValue)
        Read a property from this configuration.
        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

        boolean hasProperty​(java.lang.String name)
        Check whether a property has been set.
        Returns:
        true if property was set (even if set to null) false otherwise
      • getFeature

        <T extends Feature> T getFeature​(java.lang.Class<T> feature)
        Get a registered feature by its type (class).
      • addFeature

        IBusConfiguration addFeature​(Feature feature)
        Add a feature to the given configuration, replacing any existing feature of the same type.
        Parameters:
        feature - The feature to add
        Returns:
        A reference to this bus configuration.
      • addPublicationErrorHandler

        BusConfiguration addPublicationErrorHandler​(IPublicationErrorHandler handler)
        Add a handler that will be called whenever a publication error occurs. See PublicationError
        Parameters:
        handler - The handler to be added to the list of handlers
        Returns:
        A reference to this bus configuration.
      • getRegisteredPublicationErrorHandlers

        java.util.Collection<IPublicationErrorHandler> getRegisteredPublicationErrorHandlers()
        Get an unmodifiable collection of all registered publication error handlers