Package org.powertac.server
Class ServerPropertiesService
java.lang.Object
org.powertac.server.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 Summary
Constructors Constructor Description ServerPropertiesService()Default constructor -
Method Summary
Modifier and Type Method Description voidaddProperties(Properties props)Adds the properties in props to the current configuration.Collection<?>configureInstances(Class<?> target)voidconfigureMe(Object target)Collection<?>configureNamedInstances(List<?> instances)voidfinishConfigOutput()PropertiesgetBootstrapState()DoublegetDoubleProperty(String name, Double defaultValue)IntegergetIntegerProperty(String name, Integer defaultValue)StringgetProperty(String name)StringgetProperty(String name, String defaultValue)PropertiesgetPublishedConfiguration()Returns the published configuration as a Properties instancevoidpublishConfiguration(Object target)voidrecycle()Come here to re-configure from scratch.voidsaveBootstrapState(Object thing)voidsetApplicationContext(org.springframework.context.ApplicationContext context)voidsetConfigOutput(String filename)voidsetProperty(String key, Object value)Changes the value of a property (or adds a property).voidsetUserConfig(URL userConfigURL)
-
Constructor Details
-
ServerPropertiesService
public ServerPropertiesService()Default constructor
-
-
Method Details
-
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.ConfigurationExceptionIOException
-
setConfigOutput
-
finishConfigOutput
public void finishConfigOutput() -
addProperties
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. -
configureMe
- Specified by:
configureMein interfaceServerConfiguration
-
configureInstances
- Specified by:
configureInstancesin interfaceServerConfiguration
-
configureNamedInstances
- Specified by:
configureNamedInstancesin interfaceServerConfiguration
-
publishConfiguration
- Specified by:
publishConfigurationin interfaceServerConfiguration
-
getPublishedConfiguration
Returns the published configuration as a Properties instance -
saveBootstrapState
- Specified by:
saveBootstrapStatein interfaceServerConfiguration
-
getBootstrapState
-
getProperty
- Specified by:
getPropertyin interfaceServerProperties
-
getProperty
- Specified by:
getPropertyin interfaceServerProperties
-
getIntegerProperty
- Specified by:
getIntegerPropertyin interfaceServerProperties
-
getDoubleProperty
- Specified by:
getDoublePropertyin interfaceServerProperties
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setProperty
Changes the value of a property (or adds a property).
-