/** Set the HeirarchicalLoaderRepository3.UseParentFirst attribute based on * the value of the java2ParentDelegation property found in the config. * * @param repository the HeirarchicalLoaderRepository3 to set the * UseParentFirst attribute on. * @param config A string representation of a Properties file * @throws Exception */ public void configure(LoaderRepository repository, String config) throws Exception { HeirarchicalLoaderRepository3 hlr3 = (HeirarchicalLoaderRepository3) repository; Properties props = new Properties(); ByteArrayInputStream bais = new ByteArrayInputStream(config.getBytes()); props.load(bais); String java2ParentDelegation = props.getProperty("java2ParentDelegation"); if( java2ParentDelegation == null ) { // Check for previous mis-spelled property name java2ParentDelegation = props.getProperty("java2ParentDelegaton", "false"); } boolean useParentFirst = Boolean.valueOf(java2ParentDelegation).booleanValue(); hlr3.setUseParentFirst(useParentFirst); } }
/** Set the HeirarchicalLoaderRepository3.UseParentFirst attribute based on * the value of the java2ParentDelegation property found in the config. * * @param repository the HeirarchicalLoaderRepository3 to set the * UseParentFirst attribute on. * @param config A string representation of a Properties file * @throws Exception */ public void configure(LoaderRepository repository, String config) throws Exception { HeirarchicalLoaderRepository3 hlr3 = (HeirarchicalLoaderRepository3) repository; Properties props = new Properties(); ByteArrayInputStream bais = new ByteArrayInputStream(config.getBytes()); props.load(bais); String java2ParentDelegation = props.getProperty("java2ParentDelegation"); if( java2ParentDelegation == null ) { // Check for previous mis-spelled property name java2ParentDelegation = props.getProperty("java2ParentDelegaton", "false"); } boolean useParentFirst = Boolean.valueOf(java2ParentDelegation).booleanValue(); hlr3.setUseParentFirst(useParentFirst); } }