protected <T> T createInstance(String typeName) throws PluginRepositoryException {
Class<T> type = getType(typeName);
try {
return type.newInstance();
} catch (InstantiationException e) {
throw new PluginRepositoryException("Cannot create instance of class " + type.getName(), e);
} catch (IllegalAccessException e) {
throw new PluginRepositoryException("Cannot access class " + typeName, e);
}
}