public String getId() { return realm.getId(); }
public String getId() { return realm.getId(); }
public boolean equals(Object o) { if ( !( o instanceof ClassRealm ) ) return false; return getId().equals( ( (ClassRealm) o ).getId() ); }
public boolean equals(Object o) { if ( !( o instanceof ClassRealm ) ) return false; return getId().equals( ( (ClassRealm) o ).getId() ); } }
public boolean equals(Object o) { if ( !( o instanceof ClassRealm ) ) return false; return getId().equals( ( (ClassRealm) o ).getId() ); } }
public boolean equals(Object o) { if ( !( o instanceof ClassRealm ) ) return false; return getId().equals( ( (ClassRealm) o ).getId() ); } }
private void showUrls( ClassRealm classRealm ) { System.out.println( "this realm = " + classRealm.getId() ); URL[] urls = classRealm.getConstituents(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } System.out.println( "Number of imports: " + imports.size() ); for ( Iterator i = imports.iterator(); i.hasNext(); ) { System.out.println( "import: " + i.next() ); } } }
private ClassRealmReverseAdapter( ClassRealm oldRealm ) { super( ClassWorldReverseAdapter.getInstance( oldRealm.getWorld() ), oldRealm.getId(), oldRealm.getClassLoader() ); this.realm = oldRealm; }
private ClassRealmReverseAdapter( ClassRealm oldRealm ) { super( ClassWorldReverseAdapter.getInstance( oldRealm.getWorld() ), oldRealm.getId(), oldRealm.getClassLoader() ); this.realm = oldRealm; }
/** * 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(); } }
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 ); } }