airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1517402 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/ distribution/airavata-server/ integration-tests/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl...
Date Mon, 26 Aug 2013 00:37:05 GMT
Author: samindaw
Date: Mon Aug 26 00:37:04 2013
New Revision: 1517402

URL: http://svn.apache.org/r1517402
Log:
add registry connection timeout for jpa + updating samples version dependency in poms

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
    airavata/trunk/modules/distribution/airavata-server/pom.xml
    airavata/trunk/modules/integration-tests/pom.xml
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/xbaya-gui/pom.xml

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java?rev=1517402&r1=1517401&r2=1517402&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
Mon Aug 26 00:37:04 2013
@@ -22,7 +22,6 @@ package org.apache.airavata.client;
 
 import java.net.MalformedURLException;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
@@ -50,10 +49,8 @@ import org.apache.airavata.client.impl.U
 import org.apache.airavata.client.impl.WorkflowManagerImpl;
 import org.apache.airavata.common.exception.AiravataConfigurationException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ApplicationSettings;
 import org.apache.airavata.common.utils.Version;
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.AiravataRegistryFactory;
 import org.apache.airavata.registry.api.AiravataUser;
@@ -83,7 +80,6 @@ public class AiravataClient extends Obse
 	public static final String WORKFLOWSERVICEURL = "xbaya.service.url";
 	public static final String TRUSTED_CERT_LOCATION = "trusted.cert.location";
 	private AiravataClientConfiguration clientConfiguration;
-	private static WorkflowContextHeaderBuilder builder;
 	private String currentUser;
 	private URI regitryURI;
 	private PasswordCallback callBack;
@@ -150,9 +146,9 @@ public class AiravataClient extends Obse
 	@Override
 	public void initialize() throws AiravataAPIInvocationException {
 
-        if (AiravataUtils.isServer()) {
-            waitTillRegistryServiceStarts();
-        }
+//        if (AiravataUtils.isServer()) {
+//            waitTillRegistryServiceStarts();
+//        }
 
         try {
 			if (!configCreated) {
@@ -162,13 +158,6 @@ public class AiravataClient extends Obse
 			}
 			updateClientConfiguration(configuration);
 
-			// At this point we do not know the workflowExperimentId
-			// FIXME: Registry URL is set null as its not used. Set this when we
-			// have rest services
-			builder = new WorkflowContextHeaderBuilder(
-					configuration.get(BROKER), configuration.get(GFAC), null,
-					null, null, configuration.get(MSGBOX));
-
 			// TODO: At some point this should contain the current user the
 			// airavata
 			// client is

Modified: airavata/trunk/modules/distribution/airavata-server/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/airavata-server/pom.xml?rev=1517402&r1=1517401&r2=1517402&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/airavata-server/pom.xml (original)
+++ airavata/trunk/modules/distribution/airavata-server/pom.xml Mon Aug 26 00:37:04 2013
@@ -51,7 +51,6 @@
                                 <artifactItem>
                                     <groupId>org.apache.airavata</groupId>
                                     <artifactId>apache-airavata-samples</artifactId>
-                                    <version>${project.version}</version>
                                     <type>zip</type>
                                     <outputDirectory>${project.build.directory}/samples</outputDirectory>
                                 </artifactItem>

Modified: airavata/trunk/modules/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/integration-tests/pom.xml?rev=1517402&r1=1517401&r2=1517402&view=diff
==============================================================================
--- airavata/trunk/modules/integration-tests/pom.xml (original)
+++ airavata/trunk/modules/integration-tests/pom.xml Mon Aug 26 00:37:04 2013
@@ -43,7 +43,7 @@
 									<type>zip</type>
 								</artifactItem>
 							</artifactItems>
-							<outputDirectory>${project.build.directory}/tests</outputDirectory>
+							<outputDirectory>${tomcat.extract.dir}</outputDirectory>
 						</configuration>
 					</execution>
 				</executions>
@@ -64,7 +64,6 @@
 		                            <artifactItem>
 		                                <groupId>org.apache.airavata</groupId>
 		                                <artifactId>apache-airavata-samples</artifactId>
-		                                <version>${project.version}</version>
 		                                <type>zip</type>
 		                                <outputDirectory>${project.build.directory}/samples</outputDirectory>
 		                            </artifactItem>
@@ -347,10 +346,8 @@
         <cargo.debug.address>8000</cargo.debug.address>
         <cargo.debug.suspend>y</cargo.debug.suspend>
         <test.running.port>8080</test.running.port>
-        <tomcat.work.dir>${project.build.directory}/tests/apache-tomcat-${tomcat.version}</tomcat.work.dir>
-        <airavata.work.dir>${project.build.directory}/tests/apache-airavata-server-${project.version}</airavata.work.dir>
-        <xbaya.work.dir>${project.build.directory}/tests/apache-airavata-xbaya-gui-${project.version}</xbaya.work.dir>
-        <airavata.tomcat.distribution>${project.build.directory}/apache-airavata-tomcat.zip</airavata.tomcat.distribution>
+		<tomcat.extract.dir>${project.build.directory}</tomcat.extract.dir>
+        <tomcat.work.dir>${tomcat.extract.dir}/apache-tomcat-${tomcat.version}</tomcat.work.dir>
         <rest.service.context>airavata</rest.service.context>
         <local.tomcat.distribution>${settings.localRepository}/org/apache/airavata/integration/tomcat/apache-tomcat/${tomcat.version}/apache-tomcat-${tomcat.version}.zip</local.tomcat.distribution>
     </properties>

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1517402&r1=1517401&r2=1517402&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Mon Aug 26 00:37:04 2013
@@ -131,10 +131,14 @@ import org.slf4j.LoggerFactory;
 
 public class AiravataJPARegistry extends AiravataRegistry2{
     private final static Logger logger = LoggerFactory.getLogger(AiravataJPARegistry.class);
-    private JPAResourceAccessor jpa;
-    private boolean active=false;
+    private static Map<String, String[]> compatibleVersionMap;
+    private static int CONNECT_FAIL_WAIT_TIME=1000;
+    private static int MAX_TRIES=15;
     private static final String DEFAULT_PROJECT_NAME = "default";
     private static final Version API_VERSION=new Version("Airavata Registry API",0,9,null,null,null);
+
+    private JPAResourceAccessor jpa;
+    private boolean active=false;
     private URI registryConnectionURI;
     private ConfigurationRegistry configurationRegistry;
     private DescriptorRegistry descriptorRegistry;
@@ -142,12 +146,8 @@ public class AiravataJPARegistry extends
     private ProvenanceRegistry provenanceRegistry;
     private UserWorkflowRegistry userWorkflowRegistry;
     private PublishedWorkflowRegistry publishedWorkflowRegistry;
-    private static Map<String, String[]> compatibleVersionMap;
-
-
-
     private PasswordCallback callback;
-
+    
     @Override
     protected void initialize() throws RegistryException {
     	jpa = new JPAResourceAccessor(this);
@@ -158,16 +158,25 @@ public class AiravataJPARegistry extends
         initializeCustomRegistries();
         String apiVersion = getVersion().toString();
         String registryVersion;
-		try {
-			registryVersion = getConfiguration("registry.version").toString();
-		} catch (Exception e) {
-			if (e.getMessage().contains("does not exist")){
+        int tries=0;
+        while(true){
+			try {
+				tries++;
+				registryVersion = getConfiguration("registry.version").toString();
+				break;
+			} catch (Exception e) {
 				ResourceUtils.reset();
-				throw new AiravataRegistryUninitializedException("Airavata Registry has not yet initialized!!!",
e);
-			} else {
-				throw new RegistryException(e);
+				if (tries<MAX_TRIES){
+					try {
+						Thread.sleep(CONNECT_FAIL_WAIT_TIME);
+					} catch (InterruptedException e1) {
+						e1.printStackTrace();
+					}
+				}else{
+					throw new AiravataRegistryUninitializedException("Airavata Registry has not yet initialized
properly!!!", e);
+				}
 			}
-		}
+        }
         String[] list = compatibleVersionMap.get(apiVersion);
         if (list == null || (!Arrays.asList(list).contains(registryVersion))){
             throw new RegistryAPIVersionIncompatibleException("Incompatible registry versions.
Please check whether you updated the API and Registry " +

Modified: airavata/trunk/modules/xbaya-gui/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/pom.xml?rev=1517402&r1=1517401&r2=1517402&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/pom.xml (original)
+++ airavata/trunk/modules/xbaya-gui/pom.xml Mon Aug 26 00:37:04 2013
@@ -85,7 +85,6 @@
                                 <artifactItem>
                                     <groupId>org.apache.airavata</groupId>
                                     <artifactId>apache-airavata-samples</artifactId>
-                                    <version>${project.version}</version>
                                     <type>zip</type>
                                     <outputDirectory>${project.build.directory}/samples</outputDirectory>
                                 </artifactItem>



Mime
View raw message