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 );
} }

View File

@ -166,7 +166,7 @@ public class PluginParameterExpressionEvaluator
value = project.getExecutionProject(); value = project.getExecutionProject();
} }
else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) ) else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) )
{ {
try try
{ {
int pathSeparator = expression.indexOf( "/" ); int pathSeparator = expression.indexOf( "/" );
@ -187,7 +187,7 @@ public class PluginParameterExpressionEvaluator
// TODO: don't catch exception // TODO: don't catch exception
throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression,
e ); e );
} }
} }
else if ( expression.equals( "mojo" ) ) else if ( expression.equals( "mojo" ) )
{ {