airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1173307 - /incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
Date Tue, 20 Sep 2011 18:59:26 GMT
Author: lahiru
Date: Tue Sep 20 18:59:25 2011
New Revision: 1173307

URL: http://svn.apache.org/viewvc?rev=1173307&view=rev
Log:
fixing https://issues.apache.org/jira/browse/AIRAVATA-116.

Modified:
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java?rev=1173307&r1=1173306&r2=1173307&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
Tue Sep 20 18:59:25 2011
@@ -35,6 +35,7 @@ import javax.jcr.RepositoryFactory;
 import javax.jcr.SimpleCredentials;
 
 import org.apache.airavata.core.gfac.services.GenericService;
+import org.apache.airavata.registry.api.Registry;
 import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.services.gfac.axis2.handlers.AmazonSecurityHandler;
 import org.apache.airavata.services.gfac.axis2.handlers.MyProxySecurityHandler;
@@ -66,6 +67,7 @@ public class GFacService implements Serv
     public static final String JCR_PASS = "jcr.pass";
 
     public static GenericService service;
+    public static final String GFAC_URL = "GFacURL";
 
     public void startUp(ConfigurationContext configctx, AxisService service){
         AxisConfiguration config = null;
@@ -97,7 +99,7 @@ public class GFacService implements Serv
             RepositoryFactory repositoryFactory = (RepositoryFactory) c.newInstance();
             Repository repository = repositoryFactory.getRepository(map);
             Credentials credentials = new SimpleCredentials(map.get(JCR_USER), map.get(JCR_PASS).toCharArray());
-            JCRRegistry registry = new JCRRegistry(repository, credentials);
+            Registry registry = new JCRRegistry(repository, credentials);
             String localAddress = Utils.getIpAddress(context.getAxisConfiguration());
             String port = (String) context.getAxisConfiguration().getTransportsIn().get("http").getParameter("port").getValue();
             localAddress = "http://" + localAddress + ":" + port;
@@ -105,12 +107,16 @@ public class GFacService implements Serv
                     context.getContextRoot() + "/" + context.getServicePath() + "/" + WSConstants.GFAC_SERVICE_NAME;
             System.out.println(localAddress);
             registry.saveGFacDescriptor(localAddress);
-            context.setProperty(CONFIGURATION_CONTEXT_REGISTRY, new JCRRegistry(repository,
credentials));
+            context.setProperty(CONFIGURATION_CONTEXT_REGISTRY, registry);
+            context.setProperty(GFAC_URL,localAddress);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
     }
 
     public void shutDown(ConfigurationContext configctx, AxisService service) {
+        Registry registry = (JCRRegistry) configctx.getProperty(CONFIGURATION_CONTEXT_REGISTRY);
+        String gfacURL = (String) configctx.getProperty(GFAC_URL);
+        registry.deleteGFacDescriptor(gfacURL);
     }
 }



Mime
View raw message