Search in sources :

Example 1 with NodeSourcePlugin

use of org.ow2.proactive.resourcemanager.nodesource.NodeSourcePlugin in project scheduling by ow2-proactive.

the class NodeSourceParameterHelper method getPluginConfigurableFields.

public Collection<ConfigurableField> getPluginConfigurableFields(String pluginClassName) throws PluginNotFoundException {
    Class<NodeSourcePlugin> pluginClass = this.getPluginClassOrFail(pluginClassName);
    PluginDescriptor policyPluginDescriptor = new PluginDescriptor(pluginClass, AddonClassUtils.instantiateAddon(pluginClass), new HashMap<>());
    return policyPluginDescriptor.getConfigurableFields();
}
Also used : PluginDescriptor(org.ow2.proactive.resourcemanager.nodesource.common.PluginDescriptor) NodeSourcePlugin(org.ow2.proactive.resourcemanager.nodesource.NodeSourcePlugin)

Example 2 with NodeSourcePlugin

use of org.ow2.proactive.resourcemanager.nodesource.NodeSourcePlugin in project scheduling by ow2-proactive.

the class NodeSourceParameterHelper method getPluginClassOrFail.

private Class<NodeSourcePlugin> getPluginClassOrFail(String pluginClassName) throws PluginNotFoundException {
    Class<NodeSourcePlugin> pluginClass;
    try {
        ClassLoader currentClassLoader = this.getClass().getClassLoader();
        pluginClass = (Class<NodeSourcePlugin>) AddonClassUtils.loadClass(pluginClassName, currentClassLoader);
    } catch (ClassNotFoundException e) {
        throw new PluginNotFoundException(pluginClassName, e);
    }
    return pluginClass;
}
Also used : PluginNotFoundException(org.ow2.proactive.resourcemanager.nodesource.PluginNotFoundException) NodeSourcePlugin(org.ow2.proactive.resourcemanager.nodesource.NodeSourcePlugin)

Aggregations

NodeSourcePlugin (org.ow2.proactive.resourcemanager.nodesource.NodeSourcePlugin)2 PluginNotFoundException (org.ow2.proactive.resourcemanager.nodesource.PluginNotFoundException)1 PluginDescriptor (org.ow2.proactive.resourcemanager.nodesource.common.PluginDescriptor)1