airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1167364 - in /incubator/airavata/trunk/modules/gfac-axis2/src/main: java/org/apache/airavata/services/gfac/axis2/GFacService.java resources/repository.properties
Date Fri, 09 Sep 2011 21:19:09 GMT
Author: patanachai
Date: Fri Sep  9 21:19:09 2011
New Revision: 1167364

URL: http://svn.apache.org/viewvc?rev=1167364&view=rev
Log:
Update property file

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

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=1167364&r1=1167363&r2=1167364&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
Fri Sep  9 21:19:09 2011
@@ -17,7 +17,7 @@
  * specific language governing permissions and limitations
  * under the License.
  *
-*/
+ */
 
 package org.apache.airavata.services.gfac.axis2;
 
@@ -34,8 +34,8 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryFactory;
 import javax.jcr.SimpleCredentials;
 
-import org.apache.airavata.registry.api.impl.JCRRegistry;
 import org.apache.airavata.core.gfac.services.GenericService;
+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;
 import org.apache.axis2.context.ConfigurationContext;
@@ -43,50 +43,62 @@ import org.apache.axis2.description.Axis
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Phase;
 import org.apache.axis2.engine.ServiceLifeCycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class GFacService implements ServiceLifeCycle {
     
+    private static final Logger log = LoggerFactory.getLogger(GFacService.class);
+
     public static final String CONFIGURATION_CONTEXT_REGISTRY = "registry";
-    
-	public static final String SECURITY_CONTEXT = "security_context";
+
+    public static final String SECURITY_CONTEXT = "security_context";
     public static final String REPOSITORY_PROPERTIES = "repository.properties";
-	public static GenericService service;
 
-	public void startUp(ConfigurationContext configctx, AxisService service) {
-		AxisConfiguration config = null;
-		List<Phase> phases = null;
-		config = service.getAxisConfiguration();
-		phases = config.getInFlowPhases();
+    /*
+     * Properties for JCR
+     */
+    public static final String JCR_CLASS = "jcr.class";
+    public static final String JCR_USER = "jcr.user";
+    public static final String JCR_PASS = "jcr.pass";
+
+    public static GenericService service;
+
+    public void startUp(ConfigurationContext configctx, AxisService service){
+        AxisConfiguration config = null;
+        List<Phase> phases = null;
+        config = service.getAxisConfiguration();
+        phases = config.getInFlowPhases();
 
         initializeRepository(configctx);
 
-		for (Iterator iterator = phases.iterator(); iterator.hasNext();) {
-			Phase phase = (Phase) iterator.next();
-			if ("Security".equals(phase.getPhaseName())) {
-				phase.addHandler(new MyProxySecurityHandler());
-				phase.addHandler(new AmazonSecurityHandler());
-				return;
-			}
-		}
-	}
+        for (Iterator<Phase> iterator = phases.iterator(); iterator.hasNext();) {
+            Phase phase = (Phase) iterator.next();
+            if ("Security".equals(phase.getPhaseName())) {
+                phase.addHandler(new MyProxySecurityHandler());
+                phase.addHandler(new AmazonSecurityHandler());
+                return;
+            }
+        }
+    }
+
     private void initializeRepository(ConfigurationContext context) {
-      Properties properties = new Properties();
+        Properties properties = new Properties();
         try {
             URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
             properties.load(url.openStream());
             Map<String, String> map = new HashMap<String, String>((Map) properties);
-            Class registryRepositoryFactory = Class.forName(map.get("jcr.class"));
+            Class registryRepositoryFactory = Class.forName(map.get(JCR_CLASS));
             Constructor c = registryRepositoryFactory.getConstructor();
             RepositoryFactory repositoryFactory = (RepositoryFactory) c.newInstance();
             Repository repository = repositoryFactory.getRepository(map);
-            Credentials credentials = new SimpleCredentials(map.get("userName"), (map.get("password")).toCharArray());
+            Credentials credentials = new SimpleCredentials(map.get(JCR_USER), map.get(JCR_PASS).toCharArray());
             context.setProperty(CONFIGURATION_CONTEXT_REGISTRY, new JCRRegistry(repository,
credentials));
-    } catch (Exception e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
     }
-	public void shutDown(ConfigurationContext configctx, AxisService service) {
-		// TODO Auto-generated method stub
 
-	}
+    public void shutDown(ConfigurationContext configctx, AxisService service) {
+    }
 }

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/repository.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/repository.properties?rev=1167364&r1=1167363&r2=1167364&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/repository.properties (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/repository.properties Fri
Sep  9 21:19:09 2011
@@ -18,27 +18,49 @@
 # under the License.
 #
 #
+
+#
+# Properties for JCR Registry interface. By default, Apache Jackrabbit is used.
+#
+#jcr.class=org.apache.jackrabbit.core.RepositoryFactoryImpl
 jcr.class=org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory
 org.apache.jackrabbit.repository.uri=http://localhost:8080/rmi
 jcr.user=admin
 jcr.pass=admin
 
+
+#
+# Class which implemented Scheduler interface. It will be used to determine a Provider
+#
 scheduler.class= org.apache.airavata.core.gfac.scheduler.impl.SchedulerImpl
 
+#
+# Data Service Plugins classes
+#
 datachain.classes= org.apache.airavata.core.gfac.extension.data.RegistryDataService
 
+#
+# Pre execution Plugins classes. For example, GridFTP Input Staging
+#
 prechain.classes= org.apache.airavata.core.gfac.extension.pre.GridFtpInputStaging 
 prechain.classes= org.apache.airavata.core.gfac.extension.pre.HttpInputStaging
 
+#
+# Post execution Plugins classes. For example, GridFTP Output Staging
+#
 postchain.classes= org.apache.airavata.core.gfac.extension.post.GridFtpOutputStaging
 
-#SSH key
-#ssh.key=/home/user/.ssh/id_rsa
-#ssh.keypass=
-#ssh.username=usernameAtHost
-
-#My proxy
-#myproxy.server=myproxy.teragrid.org
-#myproxy.user=username
-#myproxy.pass=password
-#myproxy.life=3600
+#
+# SSH private key location. It will be used by SSHProvider
+#
+# ssh.key=/home/user/.ssh/id_rsa
+# ssh.keypass=
+# ssh.username=usernameAtHost
+
+#
+# MyProxy credential. It will be used by GridFTP Plugins and GramProvider.
+#
+# myproxy.server=myproxy.teragrid.org
+# myproxy.user=username
+# myproxy.pass=password
+# myproxy.life=3600
\ No newline at end of file



Mime
View raw message