You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/02/13 17:01:36 UTC
[1/3] git commit: Fixing test case with orchestrator job -
AIRAVATA-1011
Updated Branches:
refs/heads/master 5dd40195f -> 11191ef46
Fixing test case with orchestrator job - AIRAVATA-1011
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c4f80abb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c4f80abb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c4f80abb
Branch: refs/heads/master
Commit: c4f80abbd83da9217646adf637a7acdc145c4ed7
Parents: 41da886
Author: lahiru <la...@apache.org>
Authored: Thu Feb 13 10:24:25 2014 -0500
Committer: lahiru <la...@apache.org>
Committed: Thu Feb 13 10:24:25 2014 -0500
----------------------------------------------------------------------
.../core/utils/OrchestratorConstants.java | 1 +
.../core/utils/OrchestratorUtils.java | 5 ++--
.../cpi/impl/SimpleOrchestratorImpl.java | 24 +++++++++++++-------
.../orchestrator/core/NewOrchestratorTest.java | 2 ++
4 files changed, 22 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4f80abb/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorConstants.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorConstants.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorConstants.java
index bb242aa..ae22ae5 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorConstants.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorConstants.java
@@ -35,4 +35,5 @@ public class OrchestratorConstants {
public static final String START_SUBMITTER = "start.submitter";
public static final String EMBEDDED_MODE = "embedded.mode";
public static final String ENABLE_VALIDATION = "enable.validation";
+ public static final String JOB_VALIDATOR = "job.validator";
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4f80abb/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
index c65f1f4..7ff07e0 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
@@ -56,9 +56,10 @@ public class OrchestratorUtils {
orchestratorConfiguration.setStartSubmitter(Boolean.valueOf(orchestratorProps.getProperty(OrchestratorConstants.START_SUBMITTER)));
orchestratorConfiguration.setEmbeddedMode(Boolean.valueOf(orchestratorProps.getProperty(OrchestratorConstants.EMBEDDED_MODE)));
orchestratorConfiguration.setEnableValidation(Boolean.valueOf(orchestratorProps.getProperty(OrchestratorConstants.ENABLE_VALIDATION)));
+ if(orchestratorConfiguration.isEnableValidation()){
+ orchestratorConfiguration.setValidatorClass((String) orchestratorProps.get(OrchestratorConstants.JOB_VALIDATOR));
+ }
return orchestratorConfiguration;
}
-
-
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4f80abb/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 5f1aaa0..dbc3c28 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -26,6 +26,7 @@ import java.util.concurrent.Executors;
import org.apache.airavata.common.utils.AiravataJobState;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
import org.apache.airavata.orchestrator.core.job.JobSubmitter;
+import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
import org.apache.airavata.orchestrator.core.validator.JobMetadataValidator;
import org.apache.airavata.registry.api.exception.RegistryException;
import org.slf4j.Logger;
@@ -44,15 +45,20 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator {
public SimpleOrchestratorImpl() throws OrchestratorException {
try {
- try {
+ try {
String submitterClass = this.orchestratorContext.getOrchestratorConfiguration().getNewJobSubmitterClass();
Class<? extends JobSubmitter> aClass = Class.forName(submitterClass.trim()).asSubclass(JobSubmitter.class);
jobSubmitter = aClass.newInstance();
jobSubmitter.initialize(this.orchestratorContext);
String validatorClzz = this.orchestratorContext.getOrchestratorConfiguration().getValidatorClass();
- Class<? extends JobMetadataValidator> vClass = Class.forName(validatorClzz.trim()).asSubclass(JobMetadataValidator.class);
- jobMetadataValidator = vClass.newInstance();
+ if (this.orchestratorConfiguration.isEnableValidation()) {
+ if (validatorClzz == null) {
+ logger.error("Job validation class is not properly set, so Validation will be turned off !");
+ }
+ Class<? extends JobMetadataValidator> vClass = Class.forName(validatorClzz.trim()).asSubclass(JobMetadataValidator.class);
+ jobMetadataValidator = vClass.newInstance();
+ }
} catch (Exception e) {
String error = "Error creating JobSubmitter in non threaded mode ";
logger.error(error);
@@ -66,17 +72,19 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator {
public boolean launchExperiment(String experimentID) throws OrchestratorException {
// we give higher priority to userExperimentID
- if (experimentID == null) {
- logger.error("Invalid Experiment ID given: " + experimentID);
- return false;
+ if (this.orchestratorConfiguration.isEnableValidation()) {
+ if(jobMetadataValidator.validate(experimentID)){
+ logger.info("validation Successful for the experiment: " + experimentID);
+ }else {
+ throw new OrchestratorException("Validation Failed, so Job will not be submitted to GFAC");
+ }
}
try {
airavataRegistry.changeStatus(experimentID, AiravataJobState.State.ACCEPTED);
if (orchestratorContext.getOrchestratorConfiguration().getThreadPoolSize() == 0) {
jobSubmitter.directJobSubmit(experimentID);
}
- } catch (RegistryException e)
- {
+ } catch (RegistryException e) {
//todo put more meaningful error message
logger.error("Failed to create experiment for the request from " + experimentID);
return false;
http://git-wip-us.apache.org/repos/asf/airavata/blob/c4f80abb/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
index 8be0059..0bed552 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
@@ -34,6 +34,8 @@ import org.apache.airavata.model.experiment.*;
import org.apache.airavata.orchestrator.cpi.Orchestrator;
import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
+import org.apache.airavata.registry.cpi.ChildDataType;
+import org.apache.airavata.registry.cpi.ParentDataType;
import org.apache.airavata.registry.cpi.Registry;
import org.apache.airavata.schemas.gfac.*;
import org.slf4j.Logger;
[3/3] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/airavata
Posted by la...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/11191ef4
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/11191ef4
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/11191ef4
Branch: refs/heads/master
Commit: 11191ef46e91fddf108cf98e18288a2a4996a911
Parents: 3c3040d 5dd4019
Author: lahiru <la...@apache.org>
Authored: Thu Feb 13 11:01:28 2014 -0500
Committer: lahiru <la...@apache.org>
Committed: Thu Feb 13 11:01:28 2014 -0500
----------------------------------------------------------------------
airavata-api/airavata-api-server/pom.xml | 10 +
.../airavata/api/server/AiravataServer.java | 6 +-
.../api/server/util/ConnectionPool.java | 381 +++++++++++++++++++
.../api/server/util/DatabaseCreator.java | 340 +++++++++++++++++
.../airavata/api/server/util/JdbcStorage.java | 177 +++++++++
.../api/server/util/OrchestratorInitUtil.java | 25 ++
.../api/server/util/RegistryInitUtil.java | 173 +++++++++
.../main/resources/airavata-registry-derby.sql | 325 ++++++++++++++++
.../main/resources/airavata-registry-mysql.sql | 327 ++++++++++++++++
.../main/resources/airavata-server.properties | 30 +-
.../experimentModel.thrift | 40 ++
.../registry/jpa/impl/RegistryImpl.java | 39 +-
.../apache/airavata/registry/cpi/Registry.java | 14 +-
13 files changed, 1857 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
[2/3] git commit: refactoring gfac - AIRAVATA-1011
Posted by la...@apache.org.
refactoring gfac - AIRAVATA-1011
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/3c3040dd
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/3c3040dd
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/3c3040dd
Branch: refs/heads/master
Commit: 3c3040dda295b37c30ff7c47b02ca67e7fa1fe90
Parents: c4f80ab
Author: lahiru <la...@apache.org>
Authored: Thu Feb 13 11:01:14 2014 -0500
Committer: lahiru <la...@apache.org>
Committed: Thu Feb 13 11:01:14 2014 -0500
----------------------------------------------------------------------
.../apache/airavata/common/utils/Constants.java | 1 +
.../org/apache/airavata/gfac/Scheduler.java | 2 +-
.../java/org/apache/airavata/gfac/cpi/GFac.java | 97 +------
.../org/apache/airavata/gfac/cpi/GFacAPI.java | 179 ------------
.../org/apache/airavata/gfac/cpi/GFacImpl.java | 278 +++++++++++++++++++
.../gfac/services/impl/AbstractBESTest.java | 2 +-
.../gfac/services/impl/BESParallelJobTest.java | 4 +-
.../gfac/services/impl/BESProviderTest.java | 4 +-
.../core/gfac/services/impl/BigRed2Test.java | 6 +-
.../gfac/services/impl/GSISSHProviderTest.java | 6 +-
.../gfac/services/impl/GramProviderTest.java | 6 +-
.../gfac/services/impl/JSDLGeneratorTest.java | 2 +-
.../gfac/services/impl/LocalProviderTest.java | 6 +-
.../core/gfac/services/impl/ParamChemTest.java | 2 +-
.../gfac/services/impl/SSHProviderTest.java | 6 +-
.../core/gfac/services/impl/US3Test.java | 4 +-
.../airavata/gfac/ec2/EC2ProviderTest.java | 6 +-
.../core/impl/EmbeddedGFACJobSubmitter.java | 8 +-
.../xbaya/invoker/EmbeddedGFacInvoker.java | 13 +-
19 files changed, 320 insertions(+), 312 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
index 41bf161..effc4bb 100644
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Constants.java
@@ -28,4 +28,5 @@ public final class Constants {
public static final String USER_IN_SESSION = "userName";
public static final String GATEWAY_NAME = "gateway_id";
+ public static final String GFAC_CONFIG_XML = "gfac-config.xml";
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
index 8d19de1..7f0deb6 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
@@ -77,7 +77,7 @@ public class Scheduler {
HostDescription hostDescription = jobExecutionContext.getApplicationContext().getHostDescription();
String applicationName = jobExecutionContext.getServiceName();
- URL resource = Scheduler.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = Scheduler.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = null;
Document handlerDoc = null;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFac.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFac.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFac.java
index 2abef52..b9ff2c4 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFac.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFac.java
@@ -20,54 +20,15 @@
*/
package org.apache.airavata.gfac.cpi;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.scheduler.HostScheduler;
-import org.apache.airavata.gfac.utils.GFacUtils;
import org.apache.airavata.model.experiment.ConfigurationData;
-import org.apache.airavata.registry.api.AiravataRegistry2;
import org.apache.airavata.registry.cpi.DataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.net.URL;
-import java.util.*;
/**
- * This is the GFac CPI class for external usage, this simply have a single method to submit a job to
+ * This is the GFac CPI interface which needs to be implemented by an internal class, this simply have a single method to submit a job to
* the resource, required data for the job has to be stored in registry prior to invoke this object.
*/
-public class GFac {
- private static final Logger log = LoggerFactory.getLogger(GFac.class);
-
- private Registry registry;
-
- private AiravataAPI airavataAPI;
-
- private AiravataRegistry2 airavataRegistry2;
-
- /**
- * Constructor for GFac
- * @param registry
- * @param airavataAPI
- * @param airavataRegistry2
- */
- public GFac(Registry registry, AiravataAPI airavataAPI, AiravataRegistry2 airavataRegistry2) {
- this.registry = registry;
- this.airavataAPI = airavataAPI;
- this.airavataRegistry2 = airavataRegistry2;
- }
+public interface GFac {
/**
* This is the job launching method outsiders of GFac can use, this will invoke the GFac handler chain and providers
@@ -75,58 +36,8 @@ public class GFac {
*
* @param experimentID
* @return
- * @throws GFacException
+ * @throws org.apache.airavata.gfac.GFacException
*/
- public boolean submitJob(String experimentID) throws GFacException {
- ConfigurationData configurationData = (ConfigurationData) registry.get(DataType.EXPERIMENT_CONFIGURATION_DATA, experimentID);
- String serviceName = configurationData.getApplicationId();
-
- if (serviceName == null) {
- throw new GFacException("Error executing the job because there is not Application Name in this Experiment");
- }
- try {
- List<HostDescription> registeredHosts = new ArrayList<HostDescription>();
- Map<String, ApplicationDescription> applicationDescriptors = airavataRegistry2.getApplicationDescriptors(serviceName);
- for (String hostDescName : applicationDescriptors.keySet()) {
- registeredHosts.add(airavataRegistry2.getHostDescriptor(hostDescName));
- }
- Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
- HostScheduler hostScheduler = aClass.newInstance();
- HostDescription hostDescription = hostScheduler.schedule(registeredHosts);
-
- ServiceDescription serviceDescription = airavataRegistry2.getServiceDescriptor(serviceName);
-
- ApplicationDescription applicationDescription = airavataRegistry2.getApplicationDescriptors(serviceName, hostDescription.getType().getHostName());
- URL resource = GFac.class.getClassLoader().getResource("gfac-config.xml");
- Properties configurationProperties = ServerSettings.getProperties();
- GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), airavataAPI, configurationProperties);
-
- JobExecutionContext jobExecutionContext = new JobExecutionContext(gFacConfiguration, serviceName);
-
- ApplicationContext applicationContext = new ApplicationContext();
- applicationContext.setApplicationDeploymentDescription(applicationDescription);
- applicationContext.setHostDescription(hostDescription);
- applicationContext.setServiceDescription(serviceDescription);
- jobExecutionContext.setApplicationContext(applicationContext);
-
-
- Map<String, String> experimentInputs = configurationData.getExperimentInputs();
- jobExecutionContext.setInMessageContext(new MessageContext(GFacUtils.getMessageContext(experimentInputs,
- serviceDescription.getType().getInputParametersArray())));
-
- HashMap<String, Object> outputData = new HashMap<String, Object>();
- jobExecutionContext.setOutMessageContext(new MessageContext(outputData));
-
- jobExecutionContext.setProperty(Constants.PROP_TOPIC, experimentID);
- jobExecutionContext.setExperimentID(experimentID);
-
+ public boolean submitJob(String experimentID) throws GFacException;
- GFacAPI gfacAPI1 = new GFacAPI();
- gfacAPI1.submitJob(jobExecutionContext);
- } catch (Exception e) {
- log.error("Error inovoking the job with experiment ID: " + experimentID);
- throw new GFacException(e);
- }
- return true;
- }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacAPI.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacAPI.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacAPI.java
deleted file mode 100644
index 55841da..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacAPI.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.gfac.cpi;
-
-import java.util.List;
-
-import org.apache.airavata.client.AiravataClient;
-import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.Scheduler;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.handler.GFacHandler;
-import org.apache.airavata.gfac.handler.GFacHandlerConfig;
-import org.apache.airavata.gfac.handler.GFacHandlerException;
-import org.apache.airavata.gfac.notification.events.ExecutionFailEvent;
-import org.apache.airavata.gfac.notification.listeners.LoggingListener;
-import org.apache.airavata.gfac.notification.listeners.WorkflowTrackingListener;
-import org.apache.airavata.gfac.provider.GFacProvider;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class GFacAPI {
- private static final Logger log = LoggerFactory.getLogger(GFacAPI.class);
- public static final String ERROR_SENT = "ErrorSent";
-
-
- public void submitJob(JobExecutionContext jobExecutionContext) throws GFacException {
- // We need to check whether this job is submitted as a part of a large workflow. If yes,
- // we need to setup workflow tracking listerner.
- String workflowInstanceID = null;
- if ((workflowInstanceID = (String) jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_INSTANCE_ID)) != null) {
- // This mean we need to register workflow tracking listener.
- //todo implement WorkflowTrackingListener properly
- registerWorkflowTrackingListener(workflowInstanceID, jobExecutionContext);
- }
- // Register log event listener. This is required in all scenarios.
- jobExecutionContext.getNotificationService().registerListener(new LoggingListener());
- schedule(jobExecutionContext);
- }
-
- private void schedule(JobExecutionContext jobExecutionContext) throws GFacException {
- // Scheduler will decide the execution flow of handlers and provider which handles
- // the job.
- String experimentID = jobExecutionContext.getExperimentID();
- try {
- Scheduler.schedule(jobExecutionContext);
-
- // Executing in handlers in the order as they have configured in GFac configuration
- invokeInFlowHandlers(jobExecutionContext);
-// if (experimentID != null){
-// registry2.changeStatus(jobExecutionContext.getExperimentID(),AiravataJobState.State.INHANDLERSDONE);
-// }
-
- // After executing the in handlers provider instance should be set to job execution context.
- // We get the provider instance and execute it.
- GFacProvider provider = jobExecutionContext.getProvider();
- if (provider != null) {
- initProvider(provider, jobExecutionContext);
- executeProvider(provider, jobExecutionContext);
- disposeProvider(provider, jobExecutionContext);
- }
- invokeOutFlowHandlers(jobExecutionContext);
-// if (experimentID != null){
-// registry2.changeStatus(jobExecutionContext.getExperimentID(),AiravataJobState.State.OUTHANDLERSDONE);
-// }
- }catch (Exception e){
- jobExecutionContext.setProperty(ERROR_SENT,"true");
- jobExecutionContext.getNotifier().publish(new ExecutionFailEvent(e.getCause()));
- throw new GFacException(e.getMessage(),e);
- }
- }
-
- private void initProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
- try {
- provider.initialize(jobExecutionContext);
- } catch (Exception e) {
- throw new GFacException("Error while initializing provider " + provider.getClass().getName() + ".", e);
- }
- }
-
- private void executeProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
- try {
- provider.execute(jobExecutionContext);
- } catch (Exception e) {
- throw new GFacException("Error while executing provider " + provider.getClass().getName() + " functionality.", e);
- }
- }
-
- private void disposeProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
- try {
- provider.dispose(jobExecutionContext);
- } catch (Exception e) {
- throw new GFacException("Error while invoking provider " + provider.getClass().getName() + " dispose method.", e);
- }
- }
-
- private void registerWorkflowTrackingListener(String workflowInstanceID, JobExecutionContext jobExecutionContext) {
- String workflowNodeID = (String) jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_NODE_ID);
- String topic = (String) jobExecutionContext.getProperty(Constants.PROP_TOPIC);
- String brokerUrl = (String) jobExecutionContext.getProperty(Constants.PROP_BROKER_URL);
- jobExecutionContext.getNotificationService().registerListener(
- new WorkflowTrackingListener(workflowInstanceID, workflowNodeID, brokerUrl, topic));
-
- }
-
- private void invokeInFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException {
- List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getInHandlers();
- for (GFacHandlerConfig handlerClassName : handlers) {
- Class<? extends GFacHandler> handlerClass;
- GFacHandler handler;
- try {
- handlerClass = Class.forName(handlerClassName.getClassName().trim()).asSubclass(GFacHandler.class);
- handler = handlerClass.newInstance();
- handler.initProperties(handlerClassName.getProperties());
- } catch (ClassNotFoundException e) {
- throw new GFacException("Cannot load handler class " + handlerClassName, e);
- } catch (InstantiationException e) {
- throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
- } catch (IllegalAccessException e) {
- throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
- }
- try {
- handler.invoke(jobExecutionContext);
- } catch (GFacHandlerException e) {
- throw new GFacException("Error Executing a InFlow Handler", e.getCause());
- }
- }
- }
-
- private void invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException {
- List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getOutHandlers();
-
- for (GFacHandlerConfig handlerClassName : handlers) {
- Class<? extends GFacHandler> handlerClass;
- GFacHandler handler;
- try {
- handlerClass = Class.forName(handlerClassName.getClassName().trim()).asSubclass(GFacHandler.class);
- handler = handlerClass.newInstance();
- handler.initProperties(handlerClassName.getProperties());
- } catch (ClassNotFoundException e) {
- log.error(e.getMessage());
- throw new GFacException("Cannot load handler class " + handlerClassName, e);
- } catch (InstantiationException e) {
- log.error(e.getMessage());
- throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
- } catch (IllegalAccessException e) {
- log.error(e.getMessage());
- throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
- }
- try {
- handler.invoke(jobExecutionContext);
- } catch (Exception e) {
- // TODO: Better error reporting.
- throw new GFacException("Error Executing a OutFlow Handler" , e);
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
new file mode 100644
index 0000000..e4a4246
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
@@ -0,0 +1,278 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.gfac.cpi;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.gfac.Constants;
+import org.apache.airavata.gfac.GFacConfiguration;
+import org.apache.airavata.gfac.GFacException;
+import org.apache.airavata.gfac.Scheduler;
+import org.apache.airavata.gfac.context.ApplicationContext;
+import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.handler.GFacHandler;
+import org.apache.airavata.gfac.handler.GFacHandlerConfig;
+import org.apache.airavata.gfac.handler.GFacHandlerException;
+import org.apache.airavata.gfac.notification.events.ExecutionFailEvent;
+import org.apache.airavata.gfac.notification.listeners.LoggingListener;
+import org.apache.airavata.gfac.notification.listeners.WorkflowTrackingListener;
+import org.apache.airavata.gfac.provider.GFacProvider;
+import org.apache.airavata.gfac.scheduler.HostScheduler;
+import org.apache.airavata.gfac.utils.GFacUtils;
+import org.apache.airavata.model.experiment.ConfigurationData;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.cpi.DataType;
+import org.apache.airavata.registry.cpi.Registry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * This is the GFac CPI class for external usage, this simply have a single method to submit a job to
+ * the resource, required data for the job has to be stored in registry prior to invoke this object.
+ */
+public class GFacImpl implements GFac{
+ private static final Logger log = LoggerFactory.getLogger(GFacImpl.class);
+ public static final String ERROR_SENT = "ErrorSent";
+
+ private Registry registry;
+
+ private AiravataAPI airavataAPI;
+
+ private AiravataRegistry2 airavataRegistry2;
+
+ /**
+ * Constructor for GFac
+ * @param registry
+ * @param airavataAPI
+ * @param airavataRegistry2
+ */
+ public GFacImpl(Registry registry, AiravataAPI airavataAPI, AiravataRegistry2 airavataRegistry2) {
+ this.registry = registry;
+ this.airavataAPI = airavataAPI;
+ this.airavataRegistry2 = airavataRegistry2;
+ }
+
+ /**
+ * This can be used to submit jobs for testing purposes just by filling parameters by hand (JobExecutionContext)
+ */
+ public GFacImpl() {
+
+ }
+
+ /**
+ * This is the job launching method outsiders of GFac can use, this will invoke the GFac handler chain and providers
+ * And update the registry occordingly, so the users can query the database to retrieve status and output from Registry
+ *
+ * @param experimentID
+ * @return
+ * @throws GFacException
+ */
+ public boolean submitJob(String experimentID) throws GFacException {
+ ConfigurationData configurationData = (ConfigurationData) registry.get(DataType.EXPERIMENT_CONFIGURATION_DATA, experimentID);
+ String serviceName = configurationData.getApplicationId();
+
+ if (serviceName == null) {
+ throw new GFacException("Error executing the job because there is not Application Name in this Experiment");
+ }
+ try {
+ List<HostDescription> registeredHosts = new ArrayList<HostDescription>();
+ Map<String, ApplicationDescription> applicationDescriptors = airavataRegistry2.getApplicationDescriptors(serviceName);
+ for (String hostDescName : applicationDescriptors.keySet()) {
+ registeredHosts.add(airavataRegistry2.getHostDescriptor(hostDescName));
+ }
+ Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
+ HostScheduler hostScheduler = aClass.newInstance();
+ HostDescription hostDescription = hostScheduler.schedule(registeredHosts);
+
+ ServiceDescription serviceDescription = airavataRegistry2.getServiceDescriptor(serviceName);
+
+ ApplicationDescription applicationDescription = airavataRegistry2.getApplicationDescriptors(serviceName, hostDescription.getType().getHostName());
+ URL resource = GFacImpl.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
+ Properties configurationProperties = ServerSettings.getProperties();
+ GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), airavataAPI, configurationProperties);
+
+ JobExecutionContext jobExecutionContext = new JobExecutionContext(gFacConfiguration, serviceName);
+
+ ApplicationContext applicationContext = new ApplicationContext();
+ applicationContext.setApplicationDeploymentDescription(applicationDescription);
+ applicationContext.setHostDescription(hostDescription);
+ applicationContext.setServiceDescription(serviceDescription);
+ jobExecutionContext.setApplicationContext(applicationContext);
+
+
+ Map<String, String> experimentInputs = configurationData.getExperimentInputs();
+ jobExecutionContext.setInMessageContext(new MessageContext(GFacUtils.getMessageContext(experimentInputs,
+ serviceDescription.getType().getInputParametersArray())));
+
+ HashMap<String, Object> outputData = new HashMap<String, Object>();
+ jobExecutionContext.setOutMessageContext(new MessageContext(outputData));
+
+ jobExecutionContext.setProperty(Constants.PROP_TOPIC, experimentID);
+ jobExecutionContext.setExperimentID(experimentID);
+
+ submitJob(jobExecutionContext);
+ } catch (Exception e) {
+ log.error("Error inovoking the job with experiment ID: " + experimentID);
+ throw new GFacException(e);
+ }
+ return true;
+ }
+
+ public void submitJob(JobExecutionContext jobExecutionContext) throws GFacException {
+ // We need to check whether this job is submitted as a part of a large workflow. If yes,
+ // we need to setup workflow tracking listerner.
+ String workflowInstanceID = null;
+ if ((workflowInstanceID = (String) jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_INSTANCE_ID)) != null) {
+ // This mean we need to register workflow tracking listener.
+ //todo implement WorkflowTrackingListener properly
+ registerWorkflowTrackingListener(workflowInstanceID, jobExecutionContext);
+ }
+ // Register log event listener. This is required in all scenarios.
+ jobExecutionContext.getNotificationService().registerListener(new LoggingListener());
+ schedule(jobExecutionContext);
+ }
+
+ private void schedule(JobExecutionContext jobExecutionContext) throws GFacException {
+ // Scheduler will decide the execution flow of handlers and provider which handles
+ // the job.
+ String experimentID = jobExecutionContext.getExperimentID();
+ try {
+ Scheduler.schedule(jobExecutionContext);
+
+ // Executing in handlers in the order as they have configured in GFac configuration
+ invokeInFlowHandlers(jobExecutionContext);
+// if (experimentID != null){
+// registry2.changeStatus(jobExecutionContext.getExperimentID(),AiravataJobState.State.INHANDLERSDONE);
+// }
+
+ // After executing the in handlers provider instance should be set to job execution context.
+ // We get the provider instance and execute it.
+ GFacProvider provider = jobExecutionContext.getProvider();
+ if (provider != null) {
+ initProvider(provider, jobExecutionContext);
+ executeProvider(provider, jobExecutionContext);
+ disposeProvider(provider, jobExecutionContext);
+ }
+ invokeOutFlowHandlers(jobExecutionContext);
+// if (experimentID != null){
+// registry2.changeStatus(jobExecutionContext.getExperimentID(),AiravataJobState.State.OUTHANDLERSDONE);
+// }
+ }catch (Exception e){
+ jobExecutionContext.setProperty(ERROR_SENT,"true");
+ jobExecutionContext.getNotifier().publish(new ExecutionFailEvent(e.getCause()));
+ throw new GFacException(e.getMessage(),e);
+ }
+ }
+
+ private void initProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
+ try {
+ provider.initialize(jobExecutionContext);
+ } catch (Exception e) {
+ throw new GFacException("Error while initializing provider " + provider.getClass().getName() + ".", e);
+ }
+ }
+
+ private void executeProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
+ try {
+ provider.execute(jobExecutionContext);
+ } catch (Exception e) {
+ throw new GFacException("Error while executing provider " + provider.getClass().getName() + " functionality.", e);
+ }
+ }
+
+ private void disposeProvider(GFacProvider provider, JobExecutionContext jobExecutionContext) throws GFacException {
+ try {
+ provider.dispose(jobExecutionContext);
+ } catch (Exception e) {
+ throw new GFacException("Error while invoking provider " + provider.getClass().getName() + " dispose method.", e);
+ }
+ }
+
+ private void registerWorkflowTrackingListener(String workflowInstanceID, JobExecutionContext jobExecutionContext) {
+ String workflowNodeID = (String) jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_NODE_ID);
+ String topic = (String) jobExecutionContext.getProperty(Constants.PROP_TOPIC);
+ String brokerUrl = (String) jobExecutionContext.getProperty(Constants.PROP_BROKER_URL);
+ jobExecutionContext.getNotificationService().registerListener(
+ new WorkflowTrackingListener(workflowInstanceID, workflowNodeID, brokerUrl, topic));
+
+ }
+
+ private void invokeInFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException {
+ List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getInHandlers();
+ for (GFacHandlerConfig handlerClassName : handlers) {
+ Class<? extends GFacHandler> handlerClass;
+ GFacHandler handler;
+ try {
+ handlerClass = Class.forName(handlerClassName.getClassName().trim()).asSubclass(GFacHandler.class);
+ handler = handlerClass.newInstance();
+ handler.initProperties(handlerClassName.getProperties());
+ } catch (ClassNotFoundException e) {
+ throw new GFacException("Cannot load handler class " + handlerClassName, e);
+ } catch (InstantiationException e) {
+ throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
+ } catch (IllegalAccessException e) {
+ throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
+ }
+ try {
+ handler.invoke(jobExecutionContext);
+ } catch (GFacHandlerException e) {
+ throw new GFacException("Error Executing a InFlow Handler", e.getCause());
+ }
+ }
+ }
+
+ private void invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException {
+ List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getOutHandlers();
+
+ for (GFacHandlerConfig handlerClassName : handlers) {
+ Class<? extends GFacHandler> handlerClass;
+ GFacHandler handler;
+ try {
+ handlerClass = Class.forName(handlerClassName.getClassName().trim()).asSubclass(GFacHandler.class);
+ handler = handlerClass.newInstance();
+ handler.initProperties(handlerClassName.getProperties());
+ } catch (ClassNotFoundException e) {
+ log.error(e.getMessage());
+ throw new GFacException("Cannot load handler class " + handlerClassName, e);
+ } catch (InstantiationException e) {
+ log.error(e.getMessage());
+ throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
+ } catch (IllegalAccessException e) {
+ log.error(e.getMessage());
+ throw new GFacException("Cannot instantiate handler class " + handlerClassName, e);
+ }
+ try {
+ handler.invoke(jobExecutionContext);
+ } catch (Exception e) {
+ // TODO: Better error reporting.
+ throw new GFacException("Error Executing a OutFlow Handler" , e);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
index 4e4474e..2dc4131 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/AbstractBESTest.java
@@ -112,7 +112,7 @@ public abstract class AbstractBESTest extends GFacBaseTestCase {
protected GFacConfiguration getGFACConfig() throws Exception {
URL resource = this.getClass().getClassLoader()
- .getResource("gfac-config.xml");
+ .getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
System.out.println(resource.getFile());
return GFacConfiguration.create(new File(resource.getPath()), null,
null);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
index 9f5539b..86febf5 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESParallelJobTest.java
@@ -25,9 +25,9 @@ import java.util.Date;
import java.util.UUID;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.ExtendedKeyValueType;
import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
@@ -51,7 +51,7 @@ public class BESParallelJobTest extends AbstractBESTest{
ApplicationContext appContext = getApplicationContext();
appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
jobExecutionContext.setApplicationContext(appContext);
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
index 41a4c7e..900449c 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BESProviderTest.java
@@ -32,10 +32,10 @@ import java.util.UUID;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
import org.apache.airavata.schemas.gfac.InputParameterType;
@@ -66,7 +66,7 @@ public class BESProviderTest extends AbstractBESTest{
appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
jobExecutionContext.setApplicationContext(appContext);
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
index 4443d23..bca3b2b 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/BigRed2Test.java
@@ -24,7 +24,6 @@ import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.SecurityContext;
@@ -32,6 +31,7 @@ import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.gsi.ssh.api.Cluster;
import org.apache.airavata.gsi.ssh.api.SSHApiException;
import org.apache.airavata.gsi.ssh.api.ServerInfo;
@@ -66,7 +66,7 @@ public class BigRed2Test {
}
userName = System.getProperty("bigred2.username");
password = System.getProperty("bigred2.password");
- URL resource = GramProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
assert resource != null;
System.out.println(resource.getFile());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), null, null);
@@ -204,7 +204,7 @@ public class BigRed2Test {
@Test
public void testGramProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
index 283d5e2..abc41b9 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GSISSHProviderTest.java
@@ -24,7 +24,6 @@ import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.SecurityContext;
@@ -33,6 +32,7 @@ import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.GSISecurityContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.gsi.ssh.api.Cluster;
import org.apache.airavata.gsi.ssh.api.SSHApiException;
import org.apache.airavata.gsi.ssh.api.ServerInfo;
@@ -62,7 +62,7 @@ public class GSISSHProviderTest {
@Before
public void setUp() throws Exception {
- URL resource = GSISSHProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = GSISSHProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
assert resource != null;
System.out.println(resource.getFile());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), null, null);
@@ -200,7 +200,7 @@ public class GSISSHProviderTest {
}
@Test
public void testGramProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
index 6c776cd..2852e05 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/GramProviderTest.java
@@ -32,13 +32,13 @@ import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.GSISecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.GlobusHostType;
import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
@@ -70,7 +70,7 @@ public class GramProviderTest extends GFacBaseTestCase {
@Before
public void setUp() throws Exception {
- URL resource = GramProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
assert resource != null;
System.out.println(resource.getFile());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
@@ -212,7 +212,7 @@ public class GramProviderTest extends GFacBaseTestCase {
@Test
public void testGramProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
Assert.assertEquals(MappingFactory.toString((ActualParameter)outMessageContext.getParameter("echo_output")), "hello");
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
index 4d02e1c..5e2cf32 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/JSDLGeneratorTest.java
@@ -138,7 +138,7 @@ public class JSDLGeneratorTest {
}
protected GFacConfiguration getGFACConfig() throws Exception{
- URL resource = BESProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = BESProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
System.out.println(resource.getFile());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
return gFacConfiguration;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
index 5027372..c33a8bc 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
@@ -21,12 +21,12 @@
package org.apache.airavata.core.gfac.services.impl;
import org.apache.airavata.commons.gfac.type.*;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.InputParameterType;
import org.apache.airavata.schemas.gfac.OutputParameterType;
@@ -46,7 +46,7 @@ public class LocalProviderTest {
@Before
public void setUp() throws Exception {
- URL resource = this.getClass().getClassLoader().getResource("gfac-config.xml");
+ URL resource = this.getClass().getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
File configFile = new File(resource.getPath());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(configFile, null, null);
//have to set InFlwo Handlers and outFlowHandlers
@@ -142,7 +142,7 @@ public class LocalProviderTest {
@Test
public void testLocalProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
Assert.assertEquals(MappingFactory.toString((ActualParameter)outMessageContext.getParameter("echo_output")), "hello");
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
index 76d484a..5e8d1fa 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/ParamChemTest.java
@@ -297,7 +297,7 @@ public class ParamChemTest extends GFacBaseTestCase {
@Test
public void testGramProvider() throws GFacException {
-// GFacAPI gFacAPI = new GFacAPI();
+// GFacImpl gFacAPI = new GFacImpl();
// gFacAPI.submitJob(jobExecutionContext);
// MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
// Assert.assertFalse(outMessageContext.getParameters().isEmpty());
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
index e425759..5ac1b43 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SSHProviderTest.java
@@ -32,13 +32,13 @@ import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.MappingFactory;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.InputParameterType;
import org.apache.airavata.schemas.gfac.OutputParameterType;
@@ -54,7 +54,7 @@ public class SSHProviderTest {
@Before
public void setUp() throws Exception {
- URL resource = GramProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = GramProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()),null,null);
// gFacConfiguration.s
//have to set InFlwo Handlers and outFlowHandlers
@@ -164,7 +164,7 @@ public class SSHProviderTest {
@Test
public void testLocalProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
Assert.assertEquals(MappingFactory.toString((ActualParameter)outMessageContext.getParameter("echo_output")), "hello");
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
index 16f9816..bb28edb 100644
--- a/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
+++ b/modules/gfac/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/US3Test.java
@@ -26,9 +26,9 @@ import java.util.UUID;
import org.apache.airavata.commons.gfac.type.ActualParameter;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.ExtendedKeyValueType;
import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
@@ -53,7 +53,7 @@ public class US3Test extends AbstractBESTest{
ApplicationContext appContext = getApplicationContext();
appContext.setApplicationDeploymentDescription(getApplicationDesc(jobType));
jobExecutionContext.setApplicationContext(appContext);
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/gfac/gfac-ec2/src/test/java/org/apache/airavata/gfac/ec2/EC2ProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ec2/src/test/java/org/apache/airavata/gfac/ec2/EC2ProviderTest.java b/modules/gfac/gfac-ec2/src/test/java/org/apache/airavata/gfac/ec2/EC2ProviderTest.java
index 75637e8..3fdf292 100644
--- a/modules/gfac/gfac-ec2/src/test/java/org/apache/airavata/gfac/ec2/EC2ProviderTest.java
+++ b/modules/gfac/gfac-ec2/src/test/java/org/apache/airavata/gfac/ec2/EC2ProviderTest.java
@@ -22,12 +22,12 @@
package org.apache.airavata.gfac.ec2;
import org.apache.airavata.commons.gfac.type.*;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.context.ApplicationContext;
import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.schemas.gfac.*;
import org.junit.Assert;
import org.junit.Before;
@@ -80,7 +80,7 @@ public class EC2ProviderTest {
@Before
public void setUp() throws Exception {
- URL resource = EC2ProviderTest.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = EC2ProviderTest.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
assert resource != null;
System.out.println(resource.getFile());
GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), null, null);
@@ -160,7 +160,7 @@ public class EC2ProviderTest {
@Test
public void testGramProvider() throws GFacException {
- GFacAPI gFacAPI = new GFacAPI();
+ GFacImpl gFacAPI = new GFacImpl();
gFacAPI.submitJob(jobExecutionContext);
MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
Assert.assertEquals(MappingFactory.
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
index 4519cf7..f7dc0cd 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
@@ -21,17 +21,16 @@
package org.apache.airavata.orchestrator.core.impl;
-import java.io.File;
-import java.net.URL;
import java.util.*;
import org.apache.airavata.common.utils.AiravataJobState;
+import org.apache.airavata.gfac.cpi.GFac;
import org.apache.airavata.orchestrator.core.context.OrchestratorContext;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
import org.apache.airavata.orchestrator.core.job.JobSubmitter;
import org.apache.airavata.registry.cpi.Registry;
-import org.apache.airavata.gfac.cpi.GFac;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,9 +73,8 @@ public class EmbeddedGFACJobSubmitter implements JobSubmitter {
Registry newRegistry = orchestratorContext.getNewRegistry();
try {
//todo init this during submitter init
- GFac gFac = new GFac(newRegistry, orchestratorContext.getOrchestratorConfiguration().getAiravataAPI(), orchestratorContext.getRegistry());
+ GFac gFac = new GFacImpl(newRegistry, orchestratorContext.getOrchestratorConfiguration().getAiravataAPI(), orchestratorContext.getRegistry());
gFac.submitJob(experimentID);
- //FIXME: (MEP) It may be better to change the registry status in GFacAPI rather then here.
orchestratorContext.getRegistry().changeStatus(experimentID, AiravataJobState.State.SUBMITTED);
} catch (Exception e)
{
http://git-wip-us.apache.org/repos/asf/airavata/blob/3c3040dd/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
index 82826ef..29a32f4 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
@@ -41,7 +41,6 @@ import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.credential.store.store.CredentialReaderFactory;
import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.cpi.GFacAPI;
import org.apache.airavata.gfac.GFacConfiguration;
import org.apache.airavata.gfac.RequestData;
import org.apache.airavata.gfac.context.ApplicationContext;
@@ -49,6 +48,7 @@ import org.apache.airavata.gfac.context.JobExecutionContext;
import org.apache.airavata.gfac.context.MessageContext;
import org.apache.airavata.gfac.context.security.GSISecurityContext;
import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
import org.apache.airavata.gfac.scheduler.HostScheduler;
import org.apache.airavata.gfac.utils.GFacUtils;
@@ -84,8 +84,7 @@ import xsul.wsif.WSIFMessage;
import xsul.wsif.impl.WSIFMessageElement;
import xsul.xwsif_runtime.WSIFClient;
-public class
- EmbeddedGFacInvoker implements Invoker {
+public class EmbeddedGFacInvoker implements Invoker {
private static final Logger logger = LoggerFactory.getLogger(EmbeddedGFacInvoker.class);
@@ -297,7 +296,7 @@ public class
airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());
// When we run getInParameters we set the actualParameter object, this has to be fixed
- URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource("gfac-config.xml");
+ URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
OMElement inputMessage = getInParameters();
Object wsifMessageElement = new WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
this.notifier.invokingService(new WSIFMessageElement((XmlElement) wsifMessageElement));
@@ -329,7 +328,7 @@ public class
addSecurityContext(registeredHost, configurationProperties, jobExecutionContext,
configuration.getContextHeader());
- GFacAPI gfacAPI1 = new GFacAPI();
+ GFacImpl gfacAPI1 = new GFacImpl();
gfacAPI1.submitJob(jobExecutionContext);
OMFactory fac = OMAbstractFactory.getOMFactory();
@@ -422,7 +421,7 @@ public class
requestData = new RequestData(tokenId, portalUser, gatewayId);
} else {
- requestData = new RequestData("default");
+ requestData = new RequestData("default");
}
try {
@@ -446,7 +445,7 @@ public class
context.setPbsCluster(pbsCluster);
}
-
+
jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
} else if (registeredHost.getType() instanceof Ec2HostType) {
if (this.configuration.getAmazonSecurityContext() != null) {