Search in sources :

Example 1 with LocalComponentRegistry

use of org.apache.airavata.workflow.model.component.local.LocalComponentRegistry in project airavata by apache.

the class XBayaEngine method initRegistry.

/**
 * Initializes registris.
 */
private void initRegistry() {
    componentTreeViewer = this.gui.getComponentSelector();
    try {
        this.componentRegistry = new SystemComponentRegistry();
        // This does not take time, so we can do it in the same thread.
        this.systemComponentTree = ComponentController.getComponentTree(this.componentRegistry);
        componentTreeViewer.addComponentTree(0, this.systemComponentTree);
        componentTreeViewer.addComponentTree(1, ComponentController.getComponentTree(new AmazonComponentRegistry()));
    } catch (RuntimeException e) {
        // This should not happen
        logger.error(e.getMessage(), e);
        getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
    } catch (ComponentRegistryException e) {
        logger.error(e.getMessage(), e);
        getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
    }
    List<String> localRegistryPaths = this.configuration.getLocalRegistry();
    for (String path : localRegistryPaths) {
        try {
            LocalComponentRegistry registry = new LocalComponentRegistry(path);
            // XXX This might take time, so it's better to move to another
            // thread.
            ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
            componentTreeViewer.addComponentTree(componentTree);
        } catch (ComponentRegistryException e) {
            getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
        } catch (RuntimeException e) {
            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
        }
    }
}
Also used : SystemComponentRegistry(org.apache.airavata.workflow.model.component.system.SystemComponentRegistry) AmazonComponentRegistry(org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry) LocalComponentRegistry(org.apache.airavata.workflow.model.component.local.LocalComponentRegistry) ComponentRegistryException(org.apache.airavata.workflow.model.component.ComponentRegistryException) ComponentTreeNode(org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode)

Aggregations

ComponentRegistryException (org.apache.airavata.workflow.model.component.ComponentRegistryException)1 AmazonComponentRegistry (org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry)1 LocalComponentRegistry (org.apache.airavata.workflow.model.component.local.LocalComponentRegistry)1 SystemComponentRegistry (org.apache.airavata.workflow.model.component.system.SystemComponentRegistry)1 ComponentTreeNode (org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode)1