/** * Gets the order string. * * @return the order string */ private String getOrderString() { StringBuilder orderString = new StringBuilder(100); for (String id : this.instanceIds) { if (orderString.length() > 0) { orderString.append(","); } orderString.append(id).append(':').append(this.childApplicationContexts.get(id).getTypeName()); } return orderString.toString(); }
/** * Gets the order string. * * @return the order string */ private String getOrderString() { StringBuilder orderString = new StringBuilder(100); for (String id : this.instanceIds) { if (orderString.length() > 0) { orderString.append(","); } orderString.append(id).append(':').append(this.childApplicationContexts.get(id).getTypeName()); } return orderString.toString(); }
private String[] getContextResourcePatterns() { return new String[] { ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.CONTEXT_SUFFIX, ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.ENTERPRISE_CONTEXT_SUFFIX, ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + '/' + ChildApplicationContextFactory.this.getId().get( ChildApplicationContextFactory.this.getId().size() - 1) + ChildApplicationContextFactory.CONTEXT_SUFFIX }; }
private String[] getContextResourcePatterns() { return new String[] { ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.CONTEXT_SUFFIX, ChildApplicationContextFactory.CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + ChildApplicationContextFactory.ENTERPRISE_CONTEXT_SUFFIX, ChildApplicationContextFactory.EXTENSION_CLASSPATH_PREFIX + getCategory() + '/' + getTypeName() + '/' + ChildApplicationContextFactory.this.getId().get( ChildApplicationContextFactory.this.getId().size() - 1) + ChildApplicationContextFactory.CONTEXT_SUFFIX }; }
this.defaultTypeName = this.childApplicationContexts.get(this.instanceIds.get(0)).getTypeName();
this.defaultTypeName = this.childApplicationContexts.get(this.instanceIds.get(0)).getTypeName();
@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"); } }
if (factory != null && !factory.getTypeName().equals(typeName))
if (factory != null && !factory.getTypeName().equals(typeName))
@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(); }