Class ServerPropertiesService

  • All Implemented Interfaces:
    ServerConfiguration, ServerProperties, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    @Service
    public class ServerPropertiesService
    extends Object
    implements ServerProperties, ServerConfiguration, org.springframework.context.ApplicationContextAware
    Implementation of the ServerProperties and ServerConfiguration interfaces.
    Author:
    jcollins
    • Constructor Detail

      • ServerPropertiesService

        public ServerPropertiesService()
        Default constructor
    • Method Detail

      • recycle

        public void recycle()
        Come here to re-configure from scratch. This is not done as an InitializationService because it has to happen before module initialization happens.
      • setUserConfig

        public void setUserConfig​(URL userConfigURL)
                           throws org.apache.commons.configuration2.ex.ConfigurationException,
                                  IOException
        Throws:
        org.apache.commons.configuration2.ex.ConfigurationException
        IOException
      • setConfigOutput

        public void setConfigOutput​(String filename)
      • finishConfigOutput

        public void finishConfigOutput()
      • addProperties

        public void addProperties​(Properties props)
        Adds the properties in props to the current configuration. Note that it's not enough to just add the props as an additional configuration, because configurations are handled in FIFO order with respect to individual properties. Therefore, it's necessary to iterate through the properties and set them individually.
      • getPublishedConfiguration

        public Properties getPublishedConfiguration()
        Returns the published configuration as a Properties instance
      • getBootstrapState

        public Properties getBootstrapState()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext context)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • setProperty

        public void setProperty​(String key,
                                Object value)
        Changes the value of a property (or adds a property).