Package org.powertac.common.interfaces
Interface ServerConfiguration
-
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 asConfigurableValue
will be matched with configuration data, and classes annotated asConfigurableInstance
will have instances created and configured as specified in the server configuration.- Author:
- John Collins
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<?>
configureInstances(Class<?> target)
Creates and configures potentially multiple instances of a target class annotated asConfigurableInstance
.void
configureMe(Object target)
Configures a target object by matching configuration clauses withConfigurableValue
annotations on the target object.Collection<?>
configureNamedInstances(List<?> instances)
Configures a set of named instances that have already been created.void
publishConfiguration(Object target)
Gathers public configuration data for publication to brokers.void
saveBootstrapState(Object thing)
Gathers state information at the end of a boot session to be restored in a subsequent sim session.
-
-
-
Method Detail
-
configureMe
void configureMe(Object target)
Configures a target object by matching configuration clauses withConfigurableValue
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 asConfigurableInstance
. 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 fromConfigurableValue
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 fromConfigurableValue
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.
-
-