public ClassRealm getRealm( String id ) throws NoSuchRealmException { if ( realms.containsKey( id ) ) { return (ClassRealm) realms.get( id ); } throw new NoSuchRealmException( this, id ); }
public void disposeRealm( String id ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { world.disposeRealm( id ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( this, e.getId() ); } }
/** * Loads a class given its name and classpath location. * * @param location Specifies where this plugins should be obtained from, or * <code>null</code> if we should use our own classloader. * @param name The name of the class to load. * * @return The requested class. * * @throws ClassNotFoundException */ public Class<?> loadClass(AbstractClassPathLocation location, String name) throws ClassNotFoundException { // In case no location is supplied ... if (location == null) { return getClass().getClassLoader().loadClass(name); } try { if (this.initializedProperly) { final ClassLoader classLoader = this.classWorld.getRealm(location.getRealm()).getClassLoader(); return classLoader.loadClass(name); } } catch (ClassNotFoundException e) { return getClass().getClassLoader().loadClass(name); } catch (NoSuchRealmException e) { e.printStackTrace(); } // And again, this time we run this code if we have not been inititalized properly return getClass().getClassLoader().loadClass(name); }
/** Retrieve a <code>ClassRealm</code> by its id. * * @param id The id. * * @return The matching class-realm. * * @throws NoSuchRealmException If the id does not correspond * to any known class-realm. */ public ClassRealm getRealm(String id) throws NoSuchRealmException { if ( this.realms.containsKey( id ) ) { return (ClassRealm) this.realms.get( id ); } throw new NoSuchRealmException( this, id ); }
public void disposeRealm( String id ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { world.disposeRealm( id ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( this, e.getId() ); } }
/** * Returns a resource as an input stream for a given location. * * @param location The location to use. * @param name The requested resource. * @return The input stream for the requested resource or <code>null</code> if none * was found. */ public InputStream getResourceAsStream(AbstractClassPathLocation location, String name) { // In case no location is supplied ... if (location == null) { return getClass().getClassLoader().getResourceAsStream(name); } try { final ClassLoader classLoader = this.classWorld.getRealm(location.getRealm()).getClassLoader(); return classLoader.getResourceAsStream(name); } catch (NoSuchRealmException e) { e.printStackTrace(); } return null; }
public void disposeRealm( String id ) throws NoSuchRealmException { try { world.disposeRealm( id ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( this, e.getId() ); } }
public void importFrom( String realmId, String pkgName ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { realm.importFrom( realmId, pkgName ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( getWorld(), e.getId() ); } }
public void disposeRealm( String id ) throws NoSuchRealmException { try { world.disposeRealm( id ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( this, e.getId() ); } }
public org.codehaus.plexus.classworlds.realm.ClassRealm getRealm( String id ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { return ClassRealmReverseAdapter.getInstance( world.getRealm( id ) ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( this, e.getId() ); } }
public void importFrom( String realmId, String pkgName ) throws NoSuchRealmException { try { realm.importFrom( realmId, pkgName ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( getWorld(), e.getId() ); } }
public org.codehaus.plexus.classworlds.realm.ClassRealm getRealm( String id ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { return ClassRealmReverseAdapter.getInstance( world.getRealm( id ) ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( this, e.getId() ); } }
public ClassRealm getRealm( String id ) throws NoSuchRealmException { try { return ClassRealmAdapter.getInstance( world.getRealm( id ) ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( this, e.getId() ); } }
public void importFrom( String realmId, String pkgName ) throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException { try { realm.importFrom( realmId, pkgName ); } catch ( NoSuchRealmException e ) { throw new org.codehaus.plexus.classworlds.realm.NoSuchRealmException( getWorld(), e.getId() ); } }
public ClassRealm getRealm( String id ) throws NoSuchRealmException { try { return ClassRealmAdapter.getInstance( world.getRealm( id ) ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( this, e.getId() ); } }
public void importFrom( String realmId, String pkgName ) throws NoSuchRealmException { try { realm.importFrom( realmId, pkgName ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( getWorld(), e.getId() ); } }
public void configureAdapter( InputStream is ) throws IOException, MalformedURLException, ConfigurationException, DuplicateRealmException, NoSuchRealmException { try { config.configure( is ); } catch ( org.codehaus.plexus.classworlds.launcher.ConfigurationException e ) { throw new ConfigurationException( e.getMessage() ); } catch ( org.codehaus.plexus.classworlds.realm.DuplicateRealmException e ) { throw new DuplicateRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() ); } }
public void configureAdapter( InputStream is ) throws IOException, MalformedURLException, ConfigurationException, DuplicateRealmException, NoSuchRealmException { try { config.configure( is ); } catch ( org.codehaus.plexus.classworlds.launcher.ConfigurationException e ) { throw new ConfigurationException( e.getMessage() ); } catch ( org.codehaus.plexus.classworlds.realm.DuplicateRealmException e ) { throw new DuplicateRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() ); } catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e ) { throw new NoSuchRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() ); } }