@Override protected void applyDefaultOverrides(PropertyBackedBeanState state) throws IOException { // Let the superclass propagate default settings from the global properties and register us super.applyDefaultOverrides(state); List<String> idList = getId(); // Apply any property overrides from the extension classpath and also allow system properties and JNDI to // override. We use the type name and last component of the ID in the path JndiPropertiesFactoryBean overrideFactory = new JndiPropertiesFactoryBean(); overrideFactory.setPropertiesPersister(getPersister()); overrideFactory.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE); overrideFactory.setLocations(getParent().getResources( ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + '/' + idList.get(idList.size() - 1) + ChildApplicationContextFactory.PROPERTIES_SUFFIX)); overrideFactory.setProperties(((ApplicationContextState) state).properties); overrideFactory.afterPropertiesSet(); ((ApplicationContextState) state).properties = (Properties) overrideFactory.getObject(); }
@Override protected void applyDefaultOverrides(PropertyBackedBeanState state) throws IOException { // Let the superclass propagate default settings from the global properties and register us super.applyDefaultOverrides(state); List<String> idList = getId(); // Apply any property overrides from the extension classpath and also allow system properties and JNDI to // override. We use the type name and last component of the ID in the path JndiPropertiesFactoryBean overrideFactory = new JndiPropertiesFactoryBean(); overrideFactory.setPropertiesPersister(getPersister()); overrideFactory.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE); overrideFactory.setLocations(getParent().getResources( ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + '/' + idList.get(idList.size() - 1) + ChildApplicationContextFactory.PROPERTIES_SUFFIX)); overrideFactory.setProperties(((ApplicationContextState) state).properties); overrideFactory.afterPropertiesSet(); ((ApplicationContextState) state).properties = (Properties) overrideFactory.getObject(); }
/** * Instantiates a new application context state. * * @throws IOException * Signals that an I/O exception has occurred. */ protected ApplicationContextState(boolean allowInitAccess ) throws IOException { this.allowInitAccess = allowInitAccess; // Load the property defaults PropertiesFactoryBean factory = new PropertiesFactoryBean(); factory.setPropertiesPersister(getPersister()); factory.setLocations(getParent().getResources( ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.PROPERTIES_SUFFIX)); factory.afterPropertiesSet(); this.properties = (Properties) factory.getObject(); }
/** * Instantiates a new application context state. * * @throws IOException * Signals that an I/O exception has occurred. */ protected ApplicationContextState(boolean allowInitAccess ) throws IOException { this.allowInitAccess = allowInitAccess; // Load the property defaults PropertiesFactoryBean factory = new PropertiesFactoryBean(); factory.setPropertiesPersister(getPersister()); factory.setLocations(getParent().getResources( ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.PROPERTIES_SUFFIX)); factory.afterPropertiesSet(); this.properties = (Properties) factory.getObject(); }