Search in sources :

Example 1 with GATConfiguration

use of es.bsc.compss.gat.master.configuration.GATConfiguration in project compss by bsc-wdc.

the class GATAdaptor method constructConfiguration.

@Override
public Configuration constructConfiguration(Object project_properties, Object resources_properties) throws ConstructConfigurationException {
    String brokerAdaptorName = System.getProperty(COMPSsConstants.GAT_BROKER_ADAPTOR);
    String project_brokerAdaptor = (String) project_properties;
    String resources_brokerAdaptor = (String) resources_properties;
    if (project_brokerAdaptor != null) {
        if (resources_brokerAdaptor != null) {
            // Both
            if (project_brokerAdaptor.equals(resources_brokerAdaptor)) {
                // Equal, set any of them
                brokerAdaptorName = project_brokerAdaptor;
            } else {
                // Specified Broker adaptors don't match
                throw new ConstructConfigurationException("GATAdaptor: BrokerAdaptor defined in resources.xml and" + " project.xml donesn't match");
            }
        } else {
            // Only project
            brokerAdaptorName = project_brokerAdaptor;
        }
    } else {
        if (resources_brokerAdaptor != null) {
            // Only resources
            brokerAdaptorName = resources_brokerAdaptor;
        } else {
            // No broker adaptor specified, load default
            logger.debug("GAT Broker Adaptor not specified. Setting default value " + brokerAdaptorName);
        }
    }
    GATConfiguration config = new GATConfiguration(this.getClass().getName(), brokerAdaptorName);
    return config;
}
Also used : ConstructConfigurationException(es.bsc.compss.exceptions.ConstructConfigurationException) GATConfiguration(es.bsc.compss.gat.master.configuration.GATConfiguration)

Aggregations

ConstructConfigurationException (es.bsc.compss.exceptions.ConstructConfigurationException)1 GATConfiguration (es.bsc.compss.gat.master.configuration.GATConfiguration)1