You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/08/07 16:29:18 UTC
git commit: distributing updators and updating interpreter
Repository: airavata
Updated Branches:
refs/heads/master 3f216348f -> 40c44779c
distributing updators and updating interpreter
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/40c44779
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/40c44779
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/40c44779
Branch: refs/heads/master
Commit: 40c44779cc31c3e20d06039667c0cc43a6204d2e
Parents: 3f21634
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Thu Aug 7 10:29:00 2014 -0400
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Thu Aug 7 10:29:00 2014 -0400
----------------------------------------------------------------------
.../airavata/api/server/WorkflowServer.java | 4 +-
.../AiravataExperimentStatusUpdator.java | 116 ++++++++++++++++++
.../listener/ExperimentStatusChangedEvent.java | 64 ++++++++++
.../util/AiravataExperimentStatusUpdator.java | 117 -------------------
.../airavata/api/server/util/Constants.java | 4 +-
.../common/utils/AbstractActivityListener.java | 27 -----
.../listener/AbstractActivityListener.java | 27 +++++
.../listener/AbstractStateChangeRequest.java | 27 +++++
.../common/utils/listener/PublisherMessage.java | 26 +++++
.../main/resources/airavata-server.properties | 6 +-
.../airavata/gfac/core/cpi/BetterGfacImpl.java | 2 +-
.../apache/airavata/gfac/core/cpi/GFacImpl.java | 2 +-
.../core/monitor/AbstractActivityListener.java | 27 -----
.../AiravataExperimentStatusUpdator.java | 109 -----------------
.../core/monitor/AiravataJobStatusUpdator.java | 2 +-
.../core/monitor/AiravataTaskStatusUpdator.java | 2 +-
.../AiravataWorkflowNodeStatusUpdator.java | 2 +-
.../core/monitor/GfacInternalStatusUpdator.java | 2 +-
.../state/AbstractStateChangeRequest.java | 27 -----
.../state/ExperimentStatusChangedEvent.java | 63 ----------
.../monitor/state/JobStatusChangeRequest.java | 1 +
.../monitor/state/JobStatusChangedEvent.java | 1 +
.../state/TaskOutputDataChangedEvent.java | 64 ++++++++++
.../monitor/state/TaskStatusChangeRequest.java | 1 +
.../monitor/state/TaskStatusChangedEvent.java | 1 +
.../state/WorkflowNodeStatusChangedEvent.java | 1 +
.../gfac/local/provider/impl/LocalProvider.java | 22 +++-
.../engine/interpretor/WorkflowInterpreter.java | 57 +++++----
.../engine/util/ProxyMonitorPublisher.java | 2 +-
29 files changed, 395 insertions(+), 411 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
index 3893b78..34f3475 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/WorkflowServer.java
@@ -59,8 +59,8 @@ public class WorkflowServer implements IServer{
try {
AiravataUtils.setExecutionAsServer();
AppCatalogInitUtil.initializeDB();
- final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.APP_CATALOG_SERVER_PORT,"8931"));
- final String serverHost = ServerSettings.getSetting(Constants.APP_CATALOG_SERVER_HOST, null);
+ final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.WORKFLOW_SERVER_PORT,"8931"));
+ final String serverHost = ServerSettings.getSetting(Constants.WORKFLOW_SERVER_HOST, null);
TServerTransport serverTransport;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
new file mode 100644
index 0000000..ae3e67d
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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.api.server.listener;
+
+import java.util.Calendar;
+
+import org.apache.airavata.api.server.util.DataModelUtils;
+import org.apache.airavata.common.utils.MonitorPublisher;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
+import org.apache.airavata.gfac.core.monitor.state.WorkflowNodeStatusChangedEvent;
+import org.apache.airavata.model.util.ExecutionType;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.ExperimentState;
+import org.apache.airavata.registry.cpi.Registry;
+import org.apache.airavata.registry.cpi.RegistryModelType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.eventbus.Subscribe;
+
+public class AiravataExperimentStatusUpdator implements AbstractActivityListener {
+ private final static Logger logger = LoggerFactory.getLogger(AiravataExperimentStatusUpdator.class);
+
+ private Registry airavataRegistry;
+ private MonitorPublisher monitorPublisher;
+
+ public Registry getAiravataRegistry() {
+ return airavataRegistry;
+ }
+
+ public void setAiravataRegistry(Registry airavataRegistry) {
+ this.airavataRegistry = airavataRegistry;
+ }
+
+ @Subscribe
+ public void setupExperimentStatus(WorkflowNodeStatusChangedEvent nodeStatus) {
+ try {
+ boolean updateExperimentStatus=true;
+ ExperimentState state = ExperimentState.UNKNOWN;
+ switch (nodeStatus.getState()) {
+ case CANCELED:
+ state = ExperimentState.CANCELED; updateExperimentStatus = true;
+ break;
+ case COMPLETED:
+ state = ExperimentState.COMPLETED; updateExperimentStatus = false;
+ break;
+ case INVOKED:
+ state = ExperimentState.LAUNCHED; updateExperimentStatus = false;
+ break;
+ case FAILED:
+ state = ExperimentState.FAILED; updateExperimentStatus = true;
+ break;
+ case EXECUTING:
+ state = ExperimentState.EXECUTING; updateExperimentStatus = true;
+ break;
+ case CANCELING:
+ state = ExperimentState.CANCELING; updateExperimentStatus = true;
+ break;
+ default:
+ break;
+ }
+ if (!updateExperimentStatus){
+ ExecutionType executionType = DataModelUtils.getExecutionType((Experiment) airavataRegistry.get(RegistryModelType.EXPERIMENT, nodeStatus.getIdentity().getExperimentID()));
+ updateExperimentStatus=(executionType==ExecutionType.SINGLE_APP);
+ }
+ updateExperimentStatus(nodeStatus.getIdentity().getExperimentID(), state);
+ logger.debug("Publishing experiment status for "+nodeStatus.getIdentity().getExperimentID()+":"+state.toString());
+ monitorPublisher.publish(new ExperimentStatusChangedEvent(nodeStatus.getIdentity(), state));
+ } catch (Exception e) {
+ logger.error("Error persisting data" + e.getLocalizedMessage(), e);
+ }
+ }
+
+ public void updateExperimentStatus(String experimentId, ExperimentState state) throws Exception {
+ logger.info("Updating the experiment status of experiment: " + experimentId + " to " + state.toString());
+ Experiment details = (Experiment)airavataRegistry.get(RegistryModelType.EXPERIMENT, experimentId);
+ if(details == null) {
+ details = new Experiment();
+ details.setExperimentID(experimentId);
+ }
+ org.apache.airavata.model.workspace.experiment.ExperimentStatus status = new org.apache.airavata.model.workspace.experiment.ExperimentStatus();
+ status.setExperimentState(state);
+ status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
+ details.setExperimentStatus(status);
+ airavataRegistry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
+
+ }
+
+ public void setup(Object... configurations) {
+ for (Object configuration : configurations) {
+ if (configuration instanceof Registry){
+ this.airavataRegistry=(Registry)configuration;
+ } else if (configuration instanceof MonitorPublisher){
+ this.monitorPublisher=(MonitorPublisher) configuration;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/ExperimentStatusChangedEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/ExperimentStatusChangedEvent.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/ExperimentStatusChangedEvent.java
new file mode 100644
index 0000000..d4229e2
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/ExperimentStatusChangedEvent.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.api.server.listener;
+
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
+import org.apache.airavata.gfac.core.monitor.ExperimentIdentity;
+import org.apache.airavata.model.workspace.experiment.ExperimentState;
+
+/**
+ * This is the primary job state object used in
+ * through out the monitor module. This use airavata-data-model JobState enum
+ * Ideally after processing each event or monitoring message from remote system
+ * Each monitoring implementation has to return this object with a state and
+ * the monitoring ID
+ */
+public class ExperimentStatusChangedEvent extends AbstractStateChangeRequest {
+ private ExperimentState state;
+ private ExperimentIdentity identity;
+
+ // this constructor can be used in Qstat monitor to handle errors
+ public ExperimentStatusChangedEvent() {
+ }
+
+ public ExperimentStatusChangedEvent(ExperimentIdentity experimentIdentity, ExperimentState state) {
+ this.state = state;
+ setIdentity(experimentIdentity);
+ }
+
+ public ExperimentState getState() {
+ return state;
+ }
+
+ public void setState(ExperimentState state) {
+ this.state = state;
+ }
+
+ public ExperimentIdentity getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(ExperimentIdentity identity) {
+ this.identity = identity;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AiravataExperimentStatusUpdator.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AiravataExperimentStatusUpdator.java
deleted file mode 100644
index f75d95c..0000000
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/AiravataExperimentStatusUpdator.java
+++ /dev/null
@@ -1,117 +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.api.server.util;
-
-import java.util.Calendar;
-
-import org.apache.airavata.common.utils.AbstractActivityListener;
-import org.apache.airavata.common.utils.MonitorPublisher;
-import org.apache.airavata.gfac.core.monitor.state.ExperimentStatusChangedEvent;
-import org.apache.airavata.gfac.core.monitor.state.WorkflowNodeStatusChangedEvent;
-import org.apache.airavata.model.util.ExecutionType;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.registry.cpi.Registry;
-import org.apache.airavata.registry.cpi.RegistryException;
-import org.apache.airavata.registry.cpi.RegistryModelType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.eventbus.Subscribe;
-
-public class AiravataExperimentStatusUpdator implements AbstractActivityListener {
- private final static Logger logger = LoggerFactory.getLogger(AiravataExperimentStatusUpdator.class);
-
- private Registry airavataRegistry;
- private MonitorPublisher monitorPublisher;
-
- public Registry getAiravataRegistry() {
- return airavataRegistry;
- }
-
- public void setAiravataRegistry(Registry airavataRegistry) {
- this.airavataRegistry = airavataRegistry;
- }
-
- @Subscribe
- public void setupExperimentStatus(WorkflowNodeStatusChangedEvent nodeStatus) {
- try {
- boolean updateExperimentStatus=true;
- ExperimentState state = ExperimentState.UNKNOWN;
- switch (nodeStatus.getState()) {
- case CANCELED:
- state = ExperimentState.CANCELED; updateExperimentStatus = true;
- break;
- case COMPLETED:
- state = ExperimentState.COMPLETED; updateExperimentStatus = false;
- break;
- case INVOKED:
- state = ExperimentState.LAUNCHED; updateExperimentStatus = false;
- break;
- case FAILED:
- state = ExperimentState.FAILED; updateExperimentStatus = true;
- break;
- case EXECUTING:
- state = ExperimentState.EXECUTING; updateExperimentStatus = true;
- break;
- case CANCELING:
- state = ExperimentState.CANCELING; updateExperimentStatus = true;
- break;
- default:
- break;
- }
- if (!updateExperimentStatus){
- ExecutionType executionType = DataModelUtils.getExecutionType((Experiment) airavataRegistry.get(RegistryModelType.EXPERIMENT, nodeStatus.getIdentity().getExperimentID()));
- updateExperimentStatus=(executionType==ExecutionType.SINGLE_APP);
- }
- updateExperimentStatus(nodeStatus.getIdentity().getExperimentID(), state);
- logger.debug("Publishing experiment status for "+nodeStatus.getIdentity().getExperimentID()+":"+state.toString());
- monitorPublisher.publish(new ExperimentStatusChangedEvent(nodeStatus.getIdentity(), state));
- } catch (Exception e) {
- logger.error("Error persisting data" + e.getLocalizedMessage(), e);
- }
- }
-
- public void updateExperimentStatus(String experimentId, ExperimentState state) throws Exception {
- logger.info("Updating the experiment status of experiment: " + experimentId + " to " + state.toString());
- Experiment details = (Experiment)airavataRegistry.get(RegistryModelType.EXPERIMENT, experimentId);
- if(details == null) {
- details = new Experiment();
- details.setExperimentID(experimentId);
- }
- org.apache.airavata.model.workspace.experiment.ExperimentStatus status = new org.apache.airavata.model.workspace.experiment.ExperimentStatus();
- status.setExperimentState(state);
- status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
- details.setExperimentStatus(status);
- airavataRegistry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
-
- }
-
- public void setup(Object... configurations) {
- for (Object configuration : configurations) {
- if (configuration instanceof Registry){
- this.airavataRegistry=(Registry)configuration;
- } else if (configuration instanceof MonitorPublisher){
- this.monitorPublisher=(MonitorPublisher) configuration;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/Constants.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/Constants.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/Constants.java
index 5ca86cf..4a08433 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/Constants.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/Constants.java
@@ -24,7 +24,7 @@ package org.apache.airavata.api.server.util;
public class Constants {
public static final String API_SERVER_PORT = "apiserver.server.port";
public static final String API_SERVER_HOST = "apiserver.server.host";
- public static final String APP_CATALOG_SERVER_PORT = "workflow.server.port";
- public static final String APP_CATALOG_SERVER_HOST = "workflow.server.host";
+ public static final String WORKFLOW_SERVER_PORT = "workflow.server.port";
+ public static final String WORKFLOW_SERVER_HOST = "workflow.server.host";
public static final String API_SERVER_MIN_THREADS = "apiserver.server.min.threads";
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AbstractActivityListener.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AbstractActivityListener.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AbstractActivityListener.java
deleted file mode 100644
index 51922a0..0000000
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/AbstractActivityListener.java
+++ /dev/null
@@ -1,27 +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.common.utils;
-
-
-public interface AbstractActivityListener {
- public void setup(Object... configurations);
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractActivityListener.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractActivityListener.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractActivityListener.java
new file mode 100644
index 0000000..e972012
--- /dev/null
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractActivityListener.java
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.common.utils.listener;
+
+
+public interface AbstractActivityListener {
+ public void setup(Object... configurations);
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractStateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractStateChangeRequest.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractStateChangeRequest.java
new file mode 100644
index 0000000..8529c4b
--- /dev/null
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/AbstractStateChangeRequest.java
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.common.utils.listener;
+
+
+public abstract class AbstractStateChangeRequest implements PublisherMessage {
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/PublisherMessage.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/PublisherMessage.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/PublisherMessage.java
new file mode 100644
index 0000000..0d5404a
--- /dev/null
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/listener/PublisherMessage.java
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.common.utils.listener;
+
+public interface PublisherMessage {
+// public String getType();
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index 743372d..589c3d1 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -186,7 +186,7 @@ monitors=org.apache.airavata.gfac.monitor.impl.pull.qstat.QstatMonitor,org.apach
amqp.hosts=info1.dyn.teragrid.org,info2.dyn.teragrid.org
proxy.file.path=/Users/lahirugunathilake/Downloads/x509up_u503876
connection.name=xsede
-activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.util.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
+activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
###---------------------------Orchestrator module Configurations---------------------------###
#job.submitter=org.apache.airavata.orchestrator.core.impl.GFACEmbeddedJobSubmitter
@@ -238,8 +238,8 @@ gateway_id=php_reference_gateway
apiserver.server.host=localhost
apiserver.server.port=8930
apiserver.server.min.threads=50
-#app.catalog.server.host=localhost
-#app.catalog.server.port=8931
+workflow.server.host=localhost
+workflow.server.port=8931
orchestrator.server.host=localhost
orchestrator.server.port=8940
gfac.server.host=localhost
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 30e5c0a..d8dc18c 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -34,10 +34,10 @@ import org.airavata.appcatalog.cpi.AppCatalog;
import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
import org.apache.airavata.client.api.AiravataAPI;
import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.AiravataZKUtils;
import org.apache.airavata.common.utils.MonitorPublisher;
import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
index 83fb43a..877d46c 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
@@ -33,9 +33,9 @@ import javax.xml.xpath.XPathExpressionException;
import org.apache.airavata.client.api.AiravataAPI;
import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.MonitorPublisher;
import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.commons.gfac.type.ApplicationDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AbstractActivityListener.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AbstractActivityListener.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AbstractActivityListener.java
deleted file mode 100644
index 6eb1067..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AbstractActivityListener.java
+++ /dev/null
@@ -1,27 +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.core.monitor;
-//
-//
-//public interface AbstractActivityListener {
-// public void setup(Object... configurations);
-//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataExperimentStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataExperimentStatusUpdator.java
deleted file mode 100644
index 7feac06..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataExperimentStatusUpdator.java
+++ /dev/null
@@ -1,109 +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.core.monitor;
-//
-//import com.google.common.eventbus.Subscribe;
-//
-//import org.apache.airavata.gfac.core.monitor.state.ExperimentStatusChangedEvent;
-//import org.apache.airavata.gfac.core.monitor.state.WorkflowNodeStatusChangedEvent;
-//import org.apache.airavata.gfac.core.notification.MonitorPublisher;
-//import org.apache.airavata.model.workspace.experiment.Experiment;
-//import org.apache.airavata.model.workspace.experiment.ExperimentState;
-//import org.apache.airavata.registry.cpi.RegistryModelType;
-//import org.apache.airavata.registry.cpi.Registry;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//
-//import java.util.Calendar;
-//
-//public class AiravataExperimentStatusUpdator implements AbstractActivityListener {
-// private final static Logger logger = LoggerFactory.getLogger(AiravataExperimentStatusUpdator.class);
-//
-// private Registry airavataRegistry;
-// private MonitorPublisher monitorPublisher;
-//
-// public Registry getAiravataRegistry() {
-// return airavataRegistry;
-// }
-//
-// public void setAiravataRegistry(Registry airavataRegistry) {
-// this.airavataRegistry = airavataRegistry;
-// }
-//
-// @Subscribe
-// public void setupExperimentStatus(WorkflowNodeStatusChangedEvent nodeStatus) {
-// ExperimentState state = ExperimentState.UNKNOWN;
-// switch (nodeStatus.getState()) {
-// case CANCELED:
-// state = ExperimentState.CANCELED;
-// break;
-// case COMPLETED:
-// state = ExperimentState.COMPLETED;
-// break;
-// case INVOKED:
-// state = ExperimentState.LAUNCHED;
-// break;
-// case FAILED:
-// state = ExperimentState.FAILED;
-// break;
-// case EXECUTING:
-// state = ExperimentState.EXECUTING;
-// break;
-// case CANCELING:
-// state = ExperimentState.CANCELING;
-// break;
-// default:
-// break;
-// }
-// try {
-// updateExperimentStatus(nodeStatus.getIdentity().getExperimentID(), state);
-// logger.debug("Publishing experiment status for "+nodeStatus.getIdentity().getExperimentID()+":"+state.toString());
-// monitorPublisher.publish(new ExperimentStatusChangedEvent(nodeStatus.getIdentity(), state));
-// } catch (Exception e) {
-// logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-// }
-// }
-//
-// public void updateExperimentStatus(String experimentId, ExperimentState state) throws Exception {
-// logger.info("Updating the experiment status of experiment: " + experimentId + " to " + state.toString());
-// Experiment details = (Experiment)airavataRegistry.get(RegistryModelType.EXPERIMENT, experimentId);
-// if(details == null) {
-// details = new Experiment();
-// details.setExperimentID(experimentId);
-// }
-// org.apache.airavata.model.workspace.experiment.ExperimentStatus status = new org.apache.airavata.model.workspace.experiment.ExperimentStatus();
-// status.setExperimentState(state);
-// status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-// details.setExperimentStatus(status);
-// airavataRegistry.update(RegistryModelType.EXPERIMENT_STATUS, status, experimentId);
-//
-// }
-//
-// public void setup(Object... configurations) {
-// for (Object configuration : configurations) {
-// if (configuration instanceof Registry){
-// this.airavataRegistry=(Registry)configuration;
-// } else if (configuration instanceof MonitorPublisher){
-// this.monitorPublisher=(MonitorPublisher) configuration;
-// }
-// }
-// }
-//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
index 84541fc..80fa0d9 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
@@ -22,8 +22,8 @@ package org.apache.airavata.gfac.core.monitor;
import java.util.Calendar;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.MonitorPublisher;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
import org.apache.airavata.gfac.core.monitor.state.JobStatusChangedEvent;
import org.apache.airavata.model.workspace.experiment.JobDetails;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
index 5d8cc33..1e68bdc 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
@@ -22,8 +22,8 @@ package org.apache.airavata.gfac.core.monitor;
import java.util.Calendar;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.MonitorPublisher;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.gfac.core.monitor.state.JobStatusChangedEvent;
import org.apache.airavata.gfac.core.monitor.state.TaskStatusChangeRequest;
import org.apache.airavata.gfac.core.monitor.state.TaskStatusChangedEvent;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
index 365a7e2..133ff73 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
@@ -22,8 +22,8 @@ package org.apache.airavata.gfac.core.monitor;
import java.util.Calendar;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.MonitorPublisher;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.gfac.core.monitor.state.TaskStatusChangedEvent;
import org.apache.airavata.gfac.core.monitor.state.WorkflowNodeStatusChangedEvent;
import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/GfacInternalStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/GfacInternalStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/GfacInternalStatusUpdator.java
index dcef46f..896bff8 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/GfacInternalStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/GfacInternalStatusUpdator.java
@@ -24,10 +24,10 @@ import java.io.File;
import java.io.IOException;
import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.AiravataZKUtils;
import org.apache.airavata.common.utils.Constants;
import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.gfac.core.monitor.state.GfacExperimentStateChangeRequest;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/AbstractStateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/AbstractStateChangeRequest.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/AbstractStateChangeRequest.java
deleted file mode 100644
index 7db9e4b..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/AbstractStateChangeRequest.java
+++ /dev/null
@@ -1,27 +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.core.monitor.state;
-
-
-public abstract class AbstractStateChangeRequest implements PublisherMessage {
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/ExperimentStatusChangedEvent.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/ExperimentStatusChangedEvent.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/ExperimentStatusChangedEvent.java
deleted file mode 100644
index a95d46c..0000000
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/ExperimentStatusChangedEvent.java
+++ /dev/null
@@ -1,63 +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.core.monitor.state;
-
-import org.apache.airavata.gfac.core.monitor.ExperimentIdentity;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-
-/**
- * This is the primary job state object used in
- * through out the monitor module. This use airavata-data-model JobState enum
- * Ideally after processing each event or monitoring message from remote system
- * Each monitoring implementation has to return this object with a state and
- * the monitoring ID
- */
-public class ExperimentStatusChangedEvent extends AbstractStateChangeRequest {
- private ExperimentState state;
- private ExperimentIdentity identity;
-
- // this constructor can be used in Qstat monitor to handle errors
- public ExperimentStatusChangedEvent() {
- }
-
- public ExperimentStatusChangedEvent(ExperimentIdentity experimentIdentity, ExperimentState state) {
- this.state = state;
- setIdentity(experimentIdentity);
- }
-
- public ExperimentState getState() {
- return state;
- }
-
- public void setState(ExperimentState state) {
- this.state = state;
- }
-
- public ExperimentIdentity getIdentity() {
- return identity;
- }
-
- public void setIdentity(ExperimentIdentity identity) {
- this.identity = identity;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangeRequest.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangeRequest.java
index 8b308ac..e4b55f5 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangeRequest.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangeRequest.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
import org.apache.airavata.gfac.core.monitor.JobIdentity;
import org.apache.airavata.gfac.core.monitor.MonitorID;
import org.apache.airavata.model.workspace.experiment.JobState;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangedEvent.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangedEvent.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangedEvent.java
index d995f03..9589bb1 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangedEvent.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/JobStatusChangedEvent.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
import org.apache.airavata.gfac.core.monitor.JobIdentity;
import org.apache.airavata.gfac.core.monitor.MonitorID;
import org.apache.airavata.model.workspace.experiment.JobState;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskOutputDataChangedEvent.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskOutputDataChangedEvent.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskOutputDataChangedEvent.java
new file mode 100644
index 0000000..8f10637
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskOutputDataChangedEvent.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.core.monitor.state;
+
+import java.util.List;
+
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
+import org.apache.airavata.gfac.core.monitor.TaskIdentity;
+import org.apache.airavata.model.workspace.experiment.DataObjectType;
+
+/**
+ * This is the primary job state object used in
+ * through out the monitor module. This use airavata-data-model JobState enum
+ * Ideally after processing each event or monitoring message from remote system
+ * Each monitoring implementation has to return this object with a state and
+ * the monitoring ID
+ */
+public class TaskOutputDataChangedEvent extends AbstractStateChangeRequest {
+ private List<DataObjectType> output;
+ private TaskIdentity identity;
+ // this constructor can be used in Qstat monitor to handle errors
+ public TaskOutputDataChangedEvent() {
+ }
+
+ public TaskOutputDataChangedEvent(TaskIdentity taskIdentity, List<DataObjectType> output) {
+ this.output = output;
+ setIdentity(taskIdentity);
+ }
+
+ public TaskIdentity getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(TaskIdentity identity) {
+ this.identity = identity;
+ }
+
+ public List<DataObjectType> getOutput() {
+ return output;
+ }
+
+ public void setOutput(List<DataObjectType> output) {
+ this.output = output;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangeRequest.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangeRequest.java
index ec34cc9..f5ca3a7 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangeRequest.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangeRequest.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
import org.apache.airavata.gfac.core.monitor.TaskIdentity;
import org.apache.airavata.model.workspace.experiment.TaskState;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangedEvent.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangedEvent.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangedEvent.java
index ec217bc..327e4d1 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangedEvent.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/TaskStatusChangedEvent.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
import org.apache.airavata.gfac.core.monitor.TaskIdentity;
import org.apache.airavata.model.workspace.experiment.TaskState;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/WorkflowNodeStatusChangedEvent.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/WorkflowNodeStatusChangedEvent.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/WorkflowNodeStatusChangedEvent.java
index 6671add..74d4d6a 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/WorkflowNodeStatusChangedEvent.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/WorkflowNodeStatusChangedEvent.java
@@ -20,6 +20,7 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
+import org.apache.airavata.common.utils.listener.AbstractStateChangeRequest;
import org.apache.airavata.gfac.core.monitor.WorkflowNodeIdentity;
import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
index 204a99e..514f901 100644
--- a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
+++ b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
@@ -30,7 +30,9 @@ import org.apache.airavata.gfac.Constants;
import org.apache.airavata.gfac.GFacException;
import org.apache.airavata.gfac.core.context.JobExecutionContext;
import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.TaskIdentity;
import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.gfac.core.monitor.state.TaskOutputDataChangedEvent;
import org.apache.airavata.gfac.core.notification.events.StartExecutionEvent;
import org.apache.airavata.gfac.core.provider.AbstractProvider;
import org.apache.airavata.gfac.core.provider.GFacProviderException;
@@ -42,7 +44,9 @@ import org.apache.airavata.gfac.local.utils.InputUtils;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.JobDetails;
import org.apache.airavata.model.workspace.experiment.JobState;
+import org.apache.airavata.model.workspace.experiment.TaskDetails;
import org.apache.airavata.registry.cpi.ChildDataType;
+import org.apache.airavata.registry.cpi.RegistryModelType;
import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
import org.apache.airavata.schemas.gfac.NameValuePairType;
import org.apache.xmlbeans.XmlException;
@@ -169,10 +173,7 @@ public class LocalProvider extends AbstractProvider {
log.info(buf.toString());
// updating the job status to complete because there's nothing to monitor in local jobs
- MonitorID monitorID = new MonitorID(jobExecutionContext.getApplicationContext().getHostDescription(), jobId,
- jobExecutionContext.getTaskData().getTaskID(),
- jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(), jobExecutionContext.getExperimentID(),
- jobExecutionContext.getExperiment().getUserName(),jobId);
+ MonitorID monitorID = createMonitorID(jobExecutionContext);
JobStatusChangeRequest jobStatusChangeRequest = new JobStatusChangeRequest(monitorID);
jobStatusChangeRequest.setState(JobState.COMPLETE);
this.getMonitorPublisher().publish(jobStatusChangeRequest);
@@ -185,6 +186,14 @@ public class LocalProvider extends AbstractProvider {
}
}
+ private MonitorID createMonitorID(JobExecutionContext jobExecutionContext) {
+ MonitorID monitorID = new MonitorID(jobExecutionContext.getApplicationContext().getHostDescription(), jobId,
+ jobExecutionContext.getTaskData().getTaskID(),
+ jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(), jobExecutionContext.getExperimentID(),
+ jobExecutionContext.getExperiment().getUserName(),jobId);
+ return monitorID;
+ }
+
// private void saveApplicationJob(JobExecutionContext jobExecutionContext)
// throws GFacProviderException {
// ApplicationDeploymentDescriptionType app = jobExecutionContext.
@@ -215,7 +224,12 @@ public class LocalProvider extends AbstractProvider {
String stdErrStr = GFacUtils.readFileToString(app.getStandardError());
Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
OutputUtils.fillOutputFromStdout(output, stdOutStr, stdErrStr, outputArray);
+ TaskDetails taskDetails = (TaskDetails)registry.get(RegistryModelType.TASK_DETAIL, jobExecutionContext.getTaskData().getTaskID());
+ taskDetails.setApplicationOutputs(outputArray);
+ registry.update(RegistryModelType.TASK_DETAIL, taskDetails, taskDetails.getTaskID());
registry.add(ChildDataType.EXPERIMENT_OUTPUT, outputArray, jobExecutionContext.getExperimentID());
+ MonitorID monitorId = createMonitorID(jobExecutionContext);
+ getMonitorPublisher().publish(new TaskOutputDataChangedEvent(new TaskIdentity(monitorId.getExperimentID(), monitorId.getWorkflowNodeID(), monitorId.getTaskID()), outputArray));
} catch (XmlException e) {
throw new GFacProviderException("Cannot read output:" + e.getMessage(), e);
} catch (IOException io) {
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
index fadde07..606b233 100644
--- a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/interpretor/WorkflowInterpreter.java
@@ -41,9 +41,10 @@ import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.StringUtil;
import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
+import org.apache.airavata.gfac.core.monitor.state.TaskOutputDataChangedEvent;
import org.apache.airavata.gfac.core.monitor.state.TaskStatusChangedEvent;
import org.apache.airavata.model.util.ExperimentModelUtil;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
@@ -1393,10 +1394,36 @@ public class WorkflowInterpreter implements AbstractActivityListener{
@Override
public void setup(Object... configurations) {
- // TODO Auto-generated method stub
}
+ @Subscribe
+ public void taskOutputChanged(TaskOutputDataChangedEvent taskOutputEvent){
+ String taskId = taskOutputEvent.getIdentity().getTaskId();
+ if (isTaskAwaiting(taskId)){
+ WorkflowNodeState state=WorkflowNodeState.COMPLETED;
+ Node node = getAwaitingNodeForTask(taskId);
+ List<DataObjectType> applicationOutputs = taskOutputEvent.getOutput();
+ Map<String, String> outputData = new HashMap<String, String>();
+ for (DataObjectType outputObj : applicationOutputs) {
+ List<DataPort> outputPorts = node.getOutputPorts();
+ for (DataPort dataPort : outputPorts) {
+ if (dataPort.getName().equals(outputObj.getKey())){
+ outputData.put(outputObj.getKey(), outputObj.getValue());
+ }
+ }
+ }
+ nodeOutputData.put(node, outputData);
+ setupNodeDetailsOutput(node);
+ node.setState(NodeExecutionState.FINISHED);
+ try {
+ updateWorkflowNodeStatus(nodeInstanceList.get(node), state);
+ } catch (RegistryException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
@Subscribe
public void taskStatusChanged(TaskStatusChangedEvent taskStatus){
String taskId = taskStatus.getIdentity().getTaskId();
@@ -1407,26 +1434,8 @@ public class WorkflowInterpreter implements AbstractActivityListener{
case CANCELED:
; break;
case COMPLETED:
- //task is completed
- state = WorkflowNodeState.COMPLETED;
- try {
- TaskDetails task = (TaskDetails)getRegistry().get(RegistryModelType.TASK_DETAIL, taskId);
- List<DataObjectType> applicationOutputs = task.getApplicationOutputs();
- Map<String, String> outputData = new HashMap<String, String>();
- for (DataObjectType outputObj : applicationOutputs) {
- List<DataPort> outputPorts = node.getOutputPorts();
- for (DataPort dataPort : outputPorts) {
- if (dataPort.getName().equals(outputObj.getKey())){
- outputData.put(outputObj.getKey(), outputObj.getValue());
- }
- }
- }
- nodeOutputData.put(node, outputData);
- setupNodeDetailsOutput(node);
- node.setState(NodeExecutionState.FINISHED);
- } catch (RegistryException e) {
- e.printStackTrace();
- }
+ //task has completed
+ //but we'll wait for outputdata
break;
case CONFIGURING_WORKSPACE:
break;
@@ -1447,7 +1456,9 @@ public class WorkflowInterpreter implements AbstractActivityListener{
break;
}
try {
- updateWorkflowNodeStatus(nodeInstanceList.get(node), state);
+ if (state != WorkflowNodeState.UNKNOWN) {
+ updateWorkflowNodeStatus(nodeInstanceList.get(node), state);
+ }
} catch (RegistryException e) {
e.printStackTrace();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/40c44779/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/util/ProxyMonitorPublisher.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/util/ProxyMonitorPublisher.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/util/ProxyMonitorPublisher.java
index 507e1bb..e133be3 100644
--- a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/util/ProxyMonitorPublisher.java
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/util/ProxyMonitorPublisher.java
@@ -21,8 +21,8 @@
package org.apache.airavata.workflow.engine.util;
-import org.apache.airavata.common.utils.AbstractActivityListener;
import org.apache.airavata.common.utils.MonitorPublisher;
+import org.apache.airavata.common.utils.listener.AbstractActivityListener;
public class ProxyMonitorPublisher implements AbstractActivityListener{