Use plugin realm to lookup plugin components - fixes custom lifecycle mappings

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@497491 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2007-01-18 16:33:34 +00:00
parent c783818ab2
commit 18b83fe00a
1 changed files with 20 additions and 9 deletions

View File

@ -1207,20 +1207,31 @@ public class DefaultPluginManager
}
}
public Object getPluginComponent( Plugin plugin,
String role,
String roleHint )
public Object getPluginComponent( Plugin plugin, String role, String roleHint )
throws PluginManagerException, ComponentLookupException
{
// XXX this needs the plugin realm!
return container.lookup( role, roleHint );
ClassRealm pluginRealm = pluginCollector.getPluginDescriptor( plugin ).getClassRealm();
if ( pluginRealm == null )
{
getLogger().warn( "getPluginComponent(" + plugin + ", " + role + "): descriptor is missing classRealm" );
pluginRealm = DefaultPlexusContainer.getLookupRealm();
}
public Map getPluginComponents( Plugin plugin,
String role )
return container.lookup( role, roleHint, pluginRealm );
}
public Map getPluginComponents( Plugin plugin, String role )
throws ComponentLookupException, PluginManagerException
{
// XXX this needs the plugin realm!
return container.lookupMap( role );
ClassRealm pluginRealm = pluginCollector.getPluginDescriptor( plugin ).getClassRealm();
if ( pluginRealm == null )
{
getLogger().warn( "getPluginComponent(" + plugin + ", " + role + "): descriptor is missing classRealm" );
pluginRealm = DefaultPlexusContainer.getLookupRealm();
}
return container.lookupMap( role, pluginRealm );
}
}