child = new CompositeDataBean(getParent(), ChildApplicationContextFactory.this, getRegistry(), getPropertyDefaults(), getCategory(), type, childPath);
child = new CompositeDataBean(getParent(), ChildApplicationContextFactory.this, getRegistry(), getPropertyDefaults(), getCategory(), type, childPath);
@Override public void afterPropertiesSet() throws Exception { List<String> idList = getInstancePath(); if (idList.isEmpty()) { throw new IllegalStateException("Invalid instance path"); } if (getTypeName() == null) { setTypeName(idList.get(0)); } super.afterPropertiesSet(); // Validate that context files exist for this path if (new ResourceFinder(getParent()).getResources(getContextResourcePatterns()).length == 0) { throw new IllegalStateException("Invalid type " + getTypeName() + " specified for "+ getCategory() + " subsystem. No context file found"); } }
@Override public void afterPropertiesSet() throws Exception { List<String> idList = getInstancePath(); if (idList.isEmpty()) { throw new IllegalStateException("Invalid instance path"); } if (getTypeName() == null) { setTypeName(idList.get(0)); } super.afterPropertiesSet(); // Validate that context files exist for this path if (new ResourceFinder(getParent()).getResources(getContextResourcePatterns()).length == 0) { throw new IllegalStateException("Invalid type " + getTypeName() + " specified for "+ getCategory() + " subsystem. No context file found"); } }
/** * The Constructor. * * @param properties * the properties * @param compositeProperties * the composite properties * @throws BeansException * the beans exception */ private ChildApplicationContext(Properties properties, Map<String, Map<String, CompositeDataBean>> compositeProperties) throws BeansException { super(getContextResourcePatterns(), false, ChildApplicationContextFactory.this.getParent()); this.compositeProperties = compositeProperties; // Add a property placeholder configurer, with the subsystem-scoped default properties PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); configurer.setPropertiesArray(new Properties[] {ChildApplicationContextFactory.this.getPropertyDefaults(), properties}); configurer.setIgnoreUnresolvablePlaceholders(true); configurer.setSearchSystemEnvironment(false); addBeanFactoryPostProcessor(configurer); setClassLoader(ChildApplicationContextFactory.this.getParent().getClassLoader()); }
/** * The Constructor. * * @param properties * the properties * @param compositeProperties * the composite properties * @throws BeansException * the beans exception */ private ChildApplicationContext(Properties properties, Map<String, Map<String, CompositeDataBean>> compositeProperties) throws BeansException { super(getContextResourcePatterns(), false, ChildApplicationContextFactory.this.getParent()); this.compositeProperties = compositeProperties; // Add a property placeholder configurer, with the subsystem-scoped default properties PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); configurer.setPropertiesArray(new Properties[] {ChildApplicationContextFactory.this.getPropertyDefaults(), properties}); configurer.setIgnoreUnresolvablePlaceholders(true); configurer.setSearchSystemEnvironment(false); addBeanFactoryPostProcessor(configurer); setClassLoader(ChildApplicationContextFactory.this.getParent().getClassLoader()); }
@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(); }