/** Create a HeirarchicalLoaderRepository3 with an explicit parent. * * @param parent * @throws AttributeNotFoundException * @throws InstanceNotFoundException * @throws MBeanException * @throws ReflectionException */ public HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 parent) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException { this.parentRepository = parent; init(); } /** Create a HeirarchicalLoaderRepository3 with a parent obtained by querying
public int compare(LoaderRepository lr) { if (lr == this) return 0; return reverseCompare(lr); }
public RepositoryClassLoader newClassLoader(final URL url, final URL origURL, boolean addToRepository) throws Exception { UnifiedClassLoader3 ucl = null; if( java2ParentDelegation == false ) ucl = new UnifiedClassLoader3(url, origURL, new NoParentClassLoader(), this); else ucl = new UnifiedClassLoader3(url, origURL, this); if( addToRepository ) { this.addClassLoader(ucl); } return ucl; }
/** 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); } }
resource = getParentResource(name, scl); resource = getParentResource(name, scl);
public RepositoryClassLoader newClassLoader(final URL url, final URL origURL, boolean addToRepository) throws Exception { UnifiedClassLoader3 ucl = null; if( java2ParentDelegation == false ) ucl = new UnifiedClassLoader3(url, origURL, new NoParentClassLoader(), this); else ucl = new UnifiedClassLoader3(url, origURL, this); if( addToRepository ) { this.addClassLoader(ucl); } return ucl; }
/** 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); } }
resource = getParentResource(name, scl); resource = getParentResource(name, scl);
public RepositoryClassLoader newClassLoader(final URL url, boolean addToRepository) throws Exception { UnifiedClassLoader3 ucl = null; if( java2ParentDelegation == false ) ucl = new UnifiedClassLoader3(url, null, new NoParentClassLoader(), this); else ucl = new UnifiedClassLoader3(url, null, this); if( addToRepository ) { this.addClassLoader(ucl); } return ucl; } public RepositoryClassLoader newClassLoader(final URL url, final URL origURL, boolean addToRepository)
/** Create a HeirarchicalLoaderRepository3 with an explicit parent. * * @param parent * @throws AttributeNotFoundException * @throws InstanceNotFoundException * @throws MBeanException * @throws ReflectionException */ public HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 parent) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException { this.parentRepository = parent; init(); } /** Create a HeirarchicalLoaderRepository3 with a parent obtained by querying
public int compare(LoaderRepository lr) { if (lr == this) return 0; return reverseCompare(lr); }
public RepositoryClassLoader newClassLoader(final URL url, boolean addToRepository) throws Exception { UnifiedClassLoader3 ucl = null; if( java2ParentDelegation == false ) ucl = new UnifiedClassLoader3(url, null, new NoParentClassLoader(), this); else ucl = new UnifiedClassLoader3(url, null, this); if( addToRepository ) { this.addClassLoader(ucl); } return ucl; } public RepositoryClassLoader newClassLoader(final URL url, final URL origURL, boolean addToRepository)
/** Create a HeirarchicalLoaderRepository3 with a parent obtained by querying * the server for the parentName mbean. * * @param server * @param parentName * @throws AttributeNotFoundException * @throws InstanceNotFoundException * @throws MBeanException * @throws ReflectionException */ public HeirarchicalLoaderRepository3(MBeanServer server, ObjectName parentName) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException { this.parentRepository = (UnifiedLoaderRepository3) server.getAttribute(parentName, "Instance"); init(); }
/** Create a HeirarchicalLoaderRepository3 with a parent obtained by querying * the server for the parentName mbean. * * @param server * @param parentName * @throws AttributeNotFoundException * @throws InstanceNotFoundException * @throws MBeanException * @throws ReflectionException */ public HeirarchicalLoaderRepository3(MBeanServer server, ObjectName parentName) throws AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException { this.parentRepository = (UnifiedLoaderRepository3) server.getAttribute(parentName, "Instance"); init(); }