Interface ServerConfiguration

  • All Known Implementing Classes:
    ServerPropertiesService

    public interface ServerConfiguration
    Support for annotation-driven configuration. Configurable services, including services that create configurable instances (such as gencos or customer models), configure themselves by calling configure(). The result is that properties annotated as ConfigurableValue will be matched with configuration data, and classes annotated as ConfigurableInstance will have instances created and configured as specified in the server configuration.
    Author:
    John Collins
    • Method Detail

      • configureMe

        void configureMe​(Object target)
        Configures a target object by matching configuration clauses with ConfigurableValue annotations on the target object. This is typically called in the initialize() method.
      • configureInstances

        Collection<?> configureInstances​(Class<?> target)
        Creates and configures potentially multiple instances of a target class annotated as ConfigurableInstance. Returns the created instances in a list in no particular order.
      • configureNamedInstances

        Collection<?> configureNamedInstances​(List<?> instances)
        Configures a set of named instances that have already been created. This is useful for restoring instances from a bootstrap record when those instances have already been created by, for example, a dynamically configured customer model.
      • publishConfiguration

        void publishConfiguration​(Object target)
        Gathers public configuration data for publication to brokers. Data is gathered from ConfigurableValue properties with publish=true. Note that such properties must either be fields, or have a "standard" getter, or must specify a getter that produces the value as a String. This is typically called at the end of the initialize() method.
      • saveBootstrapState

        void saveBootstrapState​(Object thing)
        Gathers state information at the end of a boot session to be restored in a subsequent sim session. Data is gathered from ConfigurableValue properties with bootstrapState=true. Such properties can be fields, or may have "standard" getters and setters. This method is called at the end of a bootstrap session session by a component that wishes to have its state saved in the boot record.