airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1482162 - in /airavata/trunk/modules: airavata-client/src/main/resources/ distribution/airavata-client/src/main/resources/conf/ distribution/airavata-server/src/main/resources/conf/ registry/airavata-jpa-registry/src/main/java/org/apache/a...
Date Tue, 14 May 2013 00:58:54 GMT
Author: lahiru
Date: Tue May 14 00:58:53 2013
New Revision: 1482162

URL: http://svn.apache.org/r1482162
Log:
making validationQuery configurable.

Modified:
    airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties
    airavata/trunk/modules/distribution/airavata-client/src/main/resources/conf/airavata-client.properties
    airavata/trunk/modules/distribution/airavata-server/src/main/resources/conf/airavata-server.properties
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/airavata-client.properties
    airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
    airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-client.properties

Modified: airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties (original)
+++ airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties Tue
May 14 00:58:53 2013
@@ -42,8 +42,8 @@ registry.jdbc.url=jdbc:derby://localhost
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
-
-default.registry.user=admin
+validationQuery=SELECT 1
+defauly.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=default
@@ -62,4 +62,4 @@ trust.store.password=airavata
 #class.descriptor.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
 #class.project.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
 #class.user.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
-#class.published.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
\ No newline at end of file
+#class.published.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry

Modified: airavata/trunk/modules/distribution/airavata-client/src/main/resources/conf/airavata-client.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/airavata-client/src/main/resources/conf/airavata-client.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/airavata-client/src/main/resources/conf/airavata-client.properties
(original)
+++ airavata/trunk/modules/distribution/airavata-client/src/main/resources/conf/airavata-client.properties
Tue May 14 00:58:53 2013
@@ -42,7 +42,7 @@ registry.jdbc.url=jdbc:derby://localhost
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
-
+validationQuery=SELECT 1
 default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA

Modified: airavata/trunk/modules/distribution/airavata-server/src/main/resources/conf/airavata-server.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/airavata-server/src/main/resources/conf/airavata-server.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/airavata-server/src/main/resources/conf/airavata-server.properties
(original)
+++ airavata/trunk/modules/distribution/airavata-server/src/main/resources/conf/airavata-server.properties
Tue May 14 00:58:53 2013
@@ -59,6 +59,7 @@ default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=default
+validationQuery=SELECT 1
 #for rest [RegistryClient]
 #registry.jdbc.url=http://localhost:9080/airavata-services
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/JPAConstants.java
Tue May 14 00:58:53 2013
@@ -27,4 +27,5 @@ public class JPAConstants {
 	public static final String KEY_JDBC_PASSWORD = "registry.jdbc.password";
 	public static final String KEY_JDBC_DRIVER = "registry.jdbc.driver";
 	public static final String KEY_DERBY_START_ENABLE = "start.derby.server.mode";
+    public static final String VALIDATION_QUERY = "validationQuery";
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
Tue May 14 00:58:53 2013
@@ -47,7 +47,7 @@ public class ResourceUtils {
         if (factory == null) {
             String connectionProperties = "DriverClassName=" + Utils.getJDBCDriver() + ","
+ "Url=" + Utils.getJDBCURL() + "," +
                     "Username=" + Utils.getJDBCUser() + "," + "Password=" + Utils.getJDBCPassword()
+ ",MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=60000,validationQuery=" +
-            "Select 1,testWhileIdle=true";
+            Utils.getValidationQuery() + ",testWhileIdle=true";
             System.out.println(connectionProperties);
             Map<String, String> properties = new HashMap<String, String>();
             properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
Tue May 14 00:58:53 2013
@@ -127,6 +127,23 @@ public class Utils {
 		}
     }
 
+    public static String getValidationQuery(){
+    	try {
+			if (getProvider()!=null){
+                if(getProvider().getValue(JPAConstants.VALIDATION_QUERY) != null){
+				    return getProvider().getValue(JPAConstants.VALIDATION_QUERY).toString();
+                }
+			} else {
+                if(getProvider().getValue(JPAConstants.VALIDATION_QUERY) != null){
+                    return RegistrySettings.getSetting(JPAConstants.VALIDATION_QUERY);
+                }
+            }
+            return "";
+		} catch (RegistrySettingsException e) {
+            logger.error(e.getMessage(), e);
+            return null;
+		}
+    }
     public static String getJDBCPassword(){
     	try {
 			if (getProvider()!=null){

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/airavata-client.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/airavata-client.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/airavata-client.properties
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/airavata-client.properties
Tue May 14 00:58:53 2013
@@ -42,6 +42,7 @@ registry.jdbc.url=jdbc:derby://localhost
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
+validationQuery=SELECT 1 from Configuration
 
 default.registry.user=admin
 default.registry.password=admin

Modified: airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties (original)
+++ airavata/trunk/modules/rest/webapp/src/main/resources/airavata-server.properties Tue May
14 00:58:53 2013
@@ -59,6 +59,7 @@ default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=default
+validationQuery=SELECT 1
 #for rest [RegistryClient]
 #registry.jdbc.url=http://localhost:9080/airavata-services
 

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
Tue May 14 00:58:53 2013
@@ -26,7 +26,9 @@ import java.net.URI;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.airavata.client.api.AiravataAPIInvocationException;
 import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.registry.api.workflow.NodeExecutionError;
 import org.apache.airavata.workflow.model.graph.EPRPort;
 import org.apache.airavata.workflow.model.graph.Edge;
 import org.apache.airavata.workflow.model.graph.Graph;
@@ -161,7 +163,7 @@ public class WorkflowInterpretorEventLis
         }
     }
 
-    private void handleEvent(EventData event, boolean forward, Graph graph) {
+    private void handleEvent(EventData event, boolean forward, Graph graph) throws AiravataAPIInvocationException
{
         EventType type = event.getType();
         String nodeID = event.getNodeID();
         Node node = graph.getNode(nodeID);
@@ -205,6 +207,13 @@ public class WorkflowInterpretorEventLis
             }
         } else if (type == EventType.RECEIVED_FAULT
                 || type == EventType.SENDING_FAULT || type == EventType.SENDING_RESPONSE_FAILED)
{
+            //Constructing NodeExecutionError with required data...
+            NodeExecutionError nodeExecutionError = new NodeExecutionError();
+            nodeExecutionError.setExperimentId(event.getExperimentID());
+            nodeExecutionError.setNodeId(event.getNodeID());
+            nodeExecutionError.setWorkflowInstanceId(event.getExperimentID());
+            nodeExecutionError.setErrorMessage(event.getMessage());
+            this.workflowInterpreterConfiguration.getAiravataAPI().getExecutionManager().addNodeExecutionError(nodeExecutionError);
             if (node == null) {
             	if (nodeID!=null && !nodeID.equals("")) {
 					logger.warn("There is no node that has ID, " + nodeID);

Modified: airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-client.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-client.properties?rev=1482162&r1=1482161&r2=1482162&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-client.properties (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-client.properties Tue May
14 00:58:53 2013
@@ -42,7 +42,7 @@ registry.jdbc.url=jdbc:derby://localhost
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
-
+validationQuery=SELECT 1
 default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA



Mime
View raw message