public Collection getRealms() { Collection realms = world.getRealms(); Vector ret = new Vector(); Iterator it = realms.iterator(); while ( it.hasNext() ) { ClassRealm realm = (ClassRealm) it.next(); ret.add( ClassRealmReverseAdapter.getInstance( realm ) ); } return ret; } }
public Collection getRealms() { Collection realms = world.getRealms(); Vector ret = new Vector(); Iterator it = realms.iterator(); while ( it.hasNext() ) { ClassRealm realm = (ClassRealm) it.next(); ret.add( ClassRealmReverseAdapter.getInstance( realm ) ); } return ret; } }
/** * 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(); } }