org.powertac.server
Class ServerPropertiesService

java.lang.Object
  extended by org.powertac.server.ServerPropertiesService
All Implemented Interfaces:
org.powertac.common.interfaces.ServerConfiguration, org.powertac.common.interfaces.ServerProperties, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Service
public class ServerPropertiesService
extends Object
implements org.powertac.common.interfaces.ServerProperties, org.powertac.common.interfaces.ServerConfiguration, org.springframework.context.ApplicationContextAware

Implementation of the ServerProperties and ServerConfiguration interfaces.

Author:
jcollins

Constructor Summary
ServerPropertiesService()
          Default constructor
 
Method Summary
 Collection<?> configureInstances(Class<?> target)
           
 void configureMe(Object target)
           
 Double getDoubleProperty(String name, Double defaultValue)
           
 Integer getIntegerProperty(String name, Integer defaultValue)
           
 String getProperty(String name)
           
 String getProperty(String name, String defaultValue)
           
 Properties getPublishedConfiguration()
          Returns the published configuration as a string
 void publishConfiguration(Object target)
           
 void recycle()
          Come here to re-configure from scratch.
 void setApplicationContext(org.springframework.context.ApplicationContext context)
           
 void setProperty(String key, Object value)
          Changes the value of a property (or adds a property).
 void setUserConfig(URL userConfigURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.configuration.ConfigurationException,
                          IOException
Throws:
org.apache.commons.configuration.ConfigurationException
IOException

configureMe

public void configureMe(Object target)
Specified by:
configureMe in interface org.powertac.common.interfaces.ServerConfiguration

configureInstances

public Collection<?> configureInstances(Class<?> target)
Specified by:
configureInstances in interface org.powertac.common.interfaces.ServerConfiguration

publishConfiguration

public void publishConfiguration(Object target)
Specified by:
publishConfiguration in interface org.powertac.common.interfaces.ServerConfiguration

getPublishedConfiguration

public Properties getPublishedConfiguration()
Returns the published configuration as a string


getProperty

public String getProperty(String name)
Specified by:
getProperty in interface org.powertac.common.interfaces.ServerProperties

getProperty

public String getProperty(String name,
                          String defaultValue)
Specified by:
getProperty in interface org.powertac.common.interfaces.ServerProperties

getIntegerProperty

public Integer getIntegerProperty(String name,
                                  Integer defaultValue)
Specified by:
getIntegerProperty in interface org.powertac.common.interfaces.ServerProperties

getDoubleProperty

public Double getDoubleProperty(String name,
                                Double defaultValue)
Specified by:
getDoubleProperty in interface org.powertac.common.interfaces.ServerProperties

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).



Copyright © 2013 Power TAC. All Rights Reserved.