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

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

Introduction

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

Prototype

public void setIgnoreInvalidKeys(boolean ignoreInvalidKeys) 

Source Link

Document

Set whether to ignore invalid keys.

Usage

From source file:se.ivankrizsan.messagecowboy.ProductionPropertyOverrides.java

/**
 * Overrides properties configured on beans.
 *//*from w w w.  j  a v a2s . c o m*/
@Bean()
@Lazy(false)
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
public static BeanFactoryPostProcessor propertyOverrideConfigurer() {
    PropertyOverrideConfigurer theOverrideConfigurer = new PropertyOverrideConfigurer();

    final Properties thePropertiesHolder = new Properties();
    /* Task refresh interval. */
    thePropertiesHolder.put("starterService.taskReschedulingCronExpression", "0/20 * * * * ?");
    /* Transport service configuration refresh interval. */
    thePropertiesHolder.put("starterService.transportServiceConfigurationRefreshCronExpression",
            "0/30 * * * * ?");
    /* Task execution status reports cleanup interval. */
    thePropertiesHolder.put("starterService.taskExecutionStatusCleanupCronExpression", "0/30 0/15 * * * ?");

    theOverrideConfigurer.setProperties(thePropertiesHolder);
    theOverrideConfigurer.setIgnoreInvalidKeys(false);
    theOverrideConfigurer.setIgnoreResourceNotFound(false);
    theOverrideConfigurer.setOrder(0);
    return theOverrideConfigurer;
}

From source file:se.ivankrizsan.messagecowboy.integrationtest.taskexecutionstatuscleanup.TaskExecutionStatusCleanupTestConfiguration.java

/**
 * Overrides properties configured on beans.
 *//*from  www. j a  v  a 2 s  .  c  o m*/
@Bean()
@Lazy(false)
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
public static BeanFactoryPostProcessor propertyOverrideConfigurer() {
    PropertyOverrideConfigurer theOverrideConfigurer = new PropertyOverrideConfigurer();

    final Properties thePropertiesHolder = new Properties();
    /* Task refresh interval. */
    thePropertiesHolder.put("starterService.taskReschedulingCronExpression", "* 4/30 * * * ?");
    /* Transport service configuration refresh interval. */
    thePropertiesHolder.put("starterService.transportServiceConfigurationRefreshCronExpression",
            "* 5/30 * * * ?");
    /* Task execution status reports cleanup interval. */
    thePropertiesHolder.put("starterService.taskExecutionStatusCleanupCronExpression", "0/5 * * * * ?");

    theOverrideConfigurer.setProperties(thePropertiesHolder);
    theOverrideConfigurer.setIgnoreInvalidKeys(false);
    theOverrideConfigurer.setIgnoreResourceNotFound(false);
    theOverrideConfigurer.setOrder(0);
    return theOverrideConfigurer;
}