This commit is contained in:
Jason van Zyl 2009-05-11 05:20:53 +00:00
parent 4446b8dba7
commit 4a046065c4
4 changed files with 9 additions and 9 deletions

View File

@ -12,12 +12,12 @@ public class DefaultPluginClassLoaderCache
{ {
private Map<String,ClassRealm> pluginClassLoaders = new HashMap<String,ClassRealm>(); private Map<String,ClassRealm> pluginClassLoaders = new HashMap<String,ClassRealm>();
public void cachePluginClassLoader( String key, ClassRealm pluginClassLoader ) public void put( String key, ClassRealm pluginClassLoader )
{ {
pluginClassLoaders.put( key, pluginClassLoader ); pluginClassLoaders.put( key, pluginClassLoader );
} }
public ClassRealm getPluginClassLoader( String key ) public ClassRealm get( String key )
{ {
return pluginClassLoaders.get( key ); return pluginClassLoaders.get( key );
} }

View File

@ -198,7 +198,7 @@ public class DefaultPluginManager
} }
} }
//pluginRealm.display(); pluginRealm.display();
try try
{ {
@ -215,7 +215,7 @@ public class DefaultPluginManager
throw new PluginContainerException( plugin, pluginRealm, "Error scanning plugin realm for components.", e ); throw new PluginContainerException( plugin, pluginRealm, "Error scanning plugin realm for components.", e );
} }
pluginClassLoaderCache.cachePluginClassLoader( constructPluginKey( plugin ), pluginRealm ); pluginClassLoaderCache.put( constructPluginKey( plugin ), pluginRealm );
PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin ); PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin );
@ -345,7 +345,7 @@ public class DefaultPluginManager
mojo = getConfiguredMojo( session, mojoExecution, project, false, mojoExecution ); mojo = getConfiguredMojo( session, mojoExecution, project, false, mojoExecution );
//pluginRealm = pluginDescriptor.getClassRealm(); //pluginRealm = pluginDescriptor.getClassRealm();
pluginRealm = pluginClassLoaderCache.getPluginClassLoader( constructPluginKey( mojoDescriptor.getPluginDescriptor() ) ); pluginRealm = pluginClassLoaderCache.get( constructPluginKey( mojoDescriptor.getPluginDescriptor() ) );
Thread.currentThread().setContextClassLoader( pluginRealm ); Thread.currentThread().setContextClassLoader( pluginRealm );

View File

@ -13,7 +13,7 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm;
*/ */
public interface PluginClassLoaderCache public interface PluginClassLoaderCache
{ {
void cachePluginClassLoader( String key, ClassRealm pluginClassLoader ); void put( String key, ClassRealm pluginClassLoader );
ClassRealm getPluginClassLoader( String key ); ClassRealm get( String key );
} }