/** * Retrieve the main entry realm. * * @return The main entry realm. * @throws NoSuchRealmException If the specified main entry realm does not exist. */ public ClassRealm getMainRealm() throws NoSuchRealmException { return getWorld().getRealm( getMainRealmName() ); }
/** Retrieve the main entry realm. * * @return The main entry realm. * * @throws NoSuchRealmException If the specified main entry realm does not exist. */ public ClassRealm getMainRealm() throws NoSuchRealmException { return getWorld().getRealm(getMainRealmName()); }
/** * 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(); } }
Object ret = mainMethod.invoke( mainClass, new Object[]{args, getWorld()} ); if ( ret instanceof Integer )
ClassRealm realm = launcher.getWorld().getRealm( launcher.getMainRealmName() );