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() ); } }
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() ); } }
/** * Called by the code in remoting to launch. * @throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException */ public static int launch(String[] args) throws NoSuchMethodException, IllegalAccessException, NoSuchRealmException, InvocationTargetException, ClassNotFoundException { //ClassWorld world = ClassWorldAdapter.getInstance( launcher.getWorld() ); ClassWorld world = launcher.getWorld(); Set builtinRealms = new HashSet(world.getRealms()); try { launcher.launch(args); } finally { // delete all realms created by Maven // this is because Maven creates a child realm for each plugin it loads, // and the realm id doesn't include the version. // so unless we discard all the realms multiple invocations // that use different versions of the same plugin will fail to work correctly. Set all = new HashSet(world.getRealms()); all.removeAll(builtinRealms); for (Iterator itr = all.iterator(); itr.hasNext();) { ClassRealm cr = (ClassRealm) itr.next(); world.disposeRealm(cr.getId()); } } return launcher.getExitCode(); } }
/** * Called by the code in remoting to launch. * @throws org.codehaus.plexus.classworlds.realm.NoSuchRealmException */ public static int launch(String[] args) throws NoSuchMethodException, IllegalAccessException, NoSuchRealmException, InvocationTargetException, ClassNotFoundException { //ClassWorld world = ClassWorldAdapter.getInstance( launcher.getWorld() ); ClassWorld world = launcher.getWorld(); Set builtinRealms = new HashSet(world.getRealms()); try { launcher.launch(args); } finally { // delete all realms created by Maven // this is because Maven creates a child realm for each plugin it loads, // and the realm id doesn't include the version. // so unless we discard all the realms multiple invocations // that use different versions of the same plugin will fail to work correctly. Set all = new HashSet(world.getRealms()); all.removeAll(builtinRealms); for (Iterator itr = all.iterator(); itr.hasNext();) { ClassRealm cr = (ClassRealm) itr.next(); world.disposeRealm(cr.getId()); } } return launcher.getExitCode(); } }
this.classRealm.getWorld().disposeRealm("pom");
private ScriptFactory createScriptFactory() throws MojoExecutionException { try classRealm.getWorld().disposeRealm("jruby-all");
private ScriptFactory createScriptFactory() throws MojoExecutionException { try classRealm.getWorld().disposeRealm("jruby-all");
jruby.getWorld().disposeRealm("pom");
public void undeploy( String name ) throws ApplicationServerException { getLogger().info( "Undeploying '" + name + "'." ); ApplicationRuntimeProfile profile = getApplicationRuntimeProfile( name ); deployments.remove( name ); DefaultPlexusContainer app = (DefaultPlexusContainer) profile.getContainer(); app.dispose(); ClassRealm realm = app.getCoreRealm(); try { realm.getWorld().disposeRealm( realm.getId() ); } catch ( NoSuchRealmException e ) { getLogger().warn( "Error while disposing application realm '" + realm.getId() + "'" ); } DefaultDeployEvent event = createDeployEvent( profile ); for ( Iterator itr = applicationListeners.iterator(); itr.hasNext(); ) { ApplicationListener listener = (ApplicationListener) itr.next(); listener.undeployedApplication( event ); } }