public Void execute(final CreationalContextComponentAdapter<?> cCtx) throws Exception
{
try
{
getContainer().loadArguments(args);
ComponentPlugin cplugin = (ComponentPlugin)constructor.newInstance(args);
cplugin.setName(plugin.getName());
cplugin.setDescription(plugin.getDescription());
Class<?> clazz = getComponentImplementation();
final Method m = getSetMethod(clazz, plugin.getSetMethod(), pluginClass);
if (m == null)
{
LOG.error("Cannot find the method '" + plugin.getSetMethod()
+ "' that has only one parameter of type '" + pluginClass.getName() + "' in the class '"
+ clazz.getName() + "'.");
return null;
}
final Object[] params = {cplugin};
SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
m.invoke(cCtx.get(), params);
return null;
}
});
if (debug)
LOG.debug("==> add component plugin: " + cplugin);
cplugin.setName(plugin.getName());
cplugin.setDescription(plugin.getDescription());
return null;
}
catch (InvocationTargetException e)
{
if (e.getCause() instanceof Exception)