use of com.ibm.java.diagnostics.utils.commands.BaseCommand in project openj9 by eclipse.
the class PluginConfig method newInstance.
public ICommand newInstance(ClassLoader loader) throws CommandException {
ClassInfo info = entry.getData();
try {
Class<?> clazz = Class.forName(info.getClassname(), true, loader);
Object instance = clazz.newInstance();
if (instance instanceof BaseCommand) {
((BaseCommand) instance).setConfig(this);
}
return (ICommand) instance;
} catch (Throwable e) {
// have to use Throwable here to catch things like class not found errors
t = e;
throw new CommandException("Failed to create a new instance of command " + info.getClassname(), e);
}
}
Aggregations