Example usage for org.springframework.beans.factory.config PropertyOverrideConfigurer setLocalOverride

List of usage examples for org.springframework.beans.factory.config PropertyOverrideConfigurer setLocalOverride

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config PropertyOverrideConfigurer setLocalOverride.

Prototype

public void setLocalOverride(boolean localOverride) 

Source Link

Document

Set whether local properties override properties from files.

Usage

From source file:net.sourceforge.jabm.init.RandomVariateInitialiser.java

@Override
public Simulation initialise(SimulationController simulationController) {
    this.eventScheduler = simulationController;
    java.util.Properties variateBindings = new java.util.Properties();
    for (String variable : expressionBindings.keySet()) {
        Number value = evaluate(expressionBindings.get(variable), variateBindings);
        variateBindings.put(variable, value + "");
        logger.info(variable + " = " + value);
        fireEvent(variable, value);/*from   w  w w.j  a  v a 2 s  .co  m*/
    }
    PropertyOverrideConfigurer configurer = new PropertyOverrideConfigurer();
    configurer.setProperties(variateBindings);
    configurer.setLocalOverride(true);
    configurer.postProcessBeanFactory(
            (ConfigurableListableBeanFactory) ((SpringSimulationController) simulationController)
                    .getBeanFactory());
    return super.initialise(simulationController);
}