airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1166931 - in /incubator/airavata/trunk/modules/gfac-axis2/src/main: java/org/apache/airavata/services/gfac/axis2/ java/org/apache/airavata/services/gfac/axis2/reciever/ java/org/apache/airavata/services/gfac/axis2/util/ resources/
Date Thu, 08 Sep 2011 22:33:16 GMT
Author: patanachai
Date: Thu Sep  8 22:33:16 2011
New Revision: 1166931

URL: http://svn.apache.org/viewvc?rev=1166931&view=rev
Log:
Update to use only one 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/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.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=1166931&r1=1166930&r2=1166931&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
Thu Sep  8 22:33:16 2011
@@ -34,6 +34,7 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryFactory;
 import javax.jcr.SimpleCredentials;
 
+import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
 import org.apache.airavata.core.gfac.services.GenericService;
 import org.apache.airavata.services.gfac.axis2.handlers.AmazonSecurityHandler;
 import org.apache.airavata.services.gfac.axis2.handlers.MyProxySecurityHandler;
@@ -41,9 +42,12 @@ import org.apache.axis2.context.Configur
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Phase;
+import org.apache.axis2.engine.ServiceLifeCycle;
 
-public class GFacService implements org.apache.axis2.engine.ServiceLifeCycle {
-
+public class GFacService implements ServiceLifeCycle {
+    
+    public static final String CONFIGURATION_CONTEXT_REGISTRY = "registry";
+    
 	public static final String SECURITY_CONTEXT = "security_context";
     public static final String REPOSITORY_PROPERTIES = "repository.properties";
 	public static GenericService service;
@@ -71,13 +75,12 @@ public class GFacService implements org.
             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("repository.factory"));
+            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());
-            context.setProperty("repository",repository);
-            context.setProperty("credentials",credentials);
+            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.
         }

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1166931&r1=1166930&r2=1166931&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
Thu Sep  8 22:33:16 2011
@@ -27,14 +27,12 @@ import java.net.URI;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.jcr.Credentials;
-import javax.jcr.Repository;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.airavata.commons.gfac.api.Registry;
-import org.apache.airavata.commons.gfac.api.impl.JCRRegistry;
+import org.apache.airavata.commons.gfac.api.Axis2Registry;
 import org.apache.airavata.commons.gfac.type.Parameter;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
@@ -45,6 +43,7 @@ import org.apache.airavata.core.gfac.con
 import org.apache.airavata.core.gfac.factory.PropertyServiceFactory;
 import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
 import org.apache.airavata.core.gfac.services.GenericService;
+import org.apache.airavata.services.gfac.axis2.GFacService;
 import org.apache.airavata.services.gfac.axis2.util.GFacServiceOperations;
 import org.apache.airavata.services.gfac.axis2.util.WSDLUtil;
 import org.apache.axiom.om.OMAbstractFactory;
@@ -64,72 +63,72 @@ import org.apache.axis2.util.MessageCont
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.xmlpull.v1.builder.XmlDocument;
 import org.xmlpull.v1.builder.XmlInfosetBuilder;
+
 import xsul.wsdl.WsdlDefinitions;
 
 public class GFacMessageReciever implements MessageReceiver {
 
     private static final Log log = LogFactory.getLog(GFacMessageReciever.class);
-    public static final String SECURITY_CONTEXT = "security_context";
-    GenericService service = null;
+    private GenericService service;
+    private Axis2Registry registry;
 
     public void receive(org.apache.axis2.context.MessageContext axisRequestMsgCtx) throws
AxisFault {
         GFacServiceOperations operation = GFacServiceOperations.valueFrom(axisRequestMsgCtx.getOperationContext()
                 .getOperationName());
         switch (operation) {
-            case GETABSTRACTWSDL:
-                try {
-                    processgetAbstractWSDLOperation(axisRequestMsgCtx);
-                } catch (Exception e) {
-                    throw new AxisFault("Error retrieving the WSDL", e);
-                }
-                log.info("getAbstractWSDL operation invoked !!");
-                break;
-            case INVOKE:
-                try {
-                    processInvokeOperation(axisRequestMsgCtx);
-                    log.info("Invoke operation invoked !!");
-                } catch (Exception e) {
-                    throw new AxisFault("Error Invoking the service", e);
-                }
-                break;
-            case GETWSDL:
-                try {
-                    processgetWSDLOperation(axisRequestMsgCtx);
-                } catch (Exception e) {
-                    throw new AxisFault("Error retrieving the WSDL", e);
-                }
+        case GETABSTRACTWSDL:
+            try {
+                log.debug("invoking getAbstractWSDL operation");
+                processgetAbstractWSDLOperation(axisRequestMsgCtx);
+                log.debug("getAbstractWSDL operation invoked");
+            } catch (Exception e) {
+                throw new AxisFault("Error retrieving the WSDL", e);
+            }
+
+            break;
+        case INVOKE:
+            try {
+                log.debug("invoking Invoke operation");
+                processInvokeOperation(axisRequestMsgCtx);
+                log.info("Invoke operation invoked !!");
+            } catch (Exception e) {
+                throw new AxisFault("Error Invoking the service", e);
+            }
+            break;
+        case GETWSDL:
+            try {
+                log.debug("invoking getAbstractWSDL operation");
+                processgetWSDLOperation(axisRequestMsgCtx);
                 log.info("getWSDL operation invoked !!");
-                break;
+            } catch (Exception e) {
+                throw new AxisFault("Error retrieving the WSDL", e);
+            }
+            break;
         }
     }
 
-    public void processInvokeOperation(MessageContext messageContext) throws Exception {
+    private void processInvokeOperation(MessageContext messageContext) throws Exception {
         MessageContext response = null;
         String serviceName = getOriginalServiceName(messageContext);
         try {
             ConfigurationContext context = messageContext.getConfigurationContext();
 
             /*
-            * We assume that input likes
-            * <invoke>
-            *  <input_param_name1>value</input_param_name1>
-            *  <input_param_name2>value</input_param_name2>
-            *  <input_param_name3>value</input_param_name3>
-            * </invoke>
-            */
+             * We assume that input likes <invoke>
+             * <input_param_name1>value</input_param_name1>
+             * <input_param_name2>value</input_param_name2>
+             * <input_param_name3>value</input_param_name3> </invoke>
+             */
             OMElement invoke = messageContext.getEnvelope().getBody().getFirstElement();
 
             /*
-            * We assume that output likes
-            * <invokeResponse>
-            *  <output_param_name1>value</output_param_name1>
-            *  <output_param_name2>value</output_param_name2>
-            *  <output_param_name3>value</output_param_name3>
-            * </invokeResponse>
-            */
+             * We assume that output likes <invokeResponse>
+             * <output_param_name1>value</output_param_name1>
+             * <output_param_name2>value</output_param_name2>
+             * <output_param_name3>value</output_param_name3> </invokeResponse>
+             */
             OMElement output = invokeApplication(serviceName, invoke, context);
 
             SOAPFactory sf = OMAbstractFactory.getSOAP11Factory();
@@ -149,23 +148,18 @@ public class GFacMessageReciever impleme
             throws Exception {
         OMElement outputElement = null;
         try {
-            Repository repository = (Repository) context.getProperty("repository");
-            Credentials credentials = (Credentials) context.getProperty("credentials");
-
-            Registry regis = new JCRRegistry(repository, credentials);
             LoggingNotification notification = new LoggingNotification();
 
             DefaultInvocationContext ct = new DefaultInvocationContext();
             ct.setExecutionContext(new DefaultExecutionContext());
             ct.setServiceName(serviceName);
-            ct.getExecutionContext().setRegistryService(regis);
+            ct.getExecutionContext().setRegistryService(getRegistry(context));
             ct.getExecutionContext().setNotificationService(notification);
 
-
             /*
-            * read from registry and set the correct parameters
-            */
-            ServiceDescription serviceDescription = regis.getServiceDescription(serviceName);
+             * read from registry and set the correct parameters
+             */
+            ServiceDescription serviceDescription = getRegistry(context).getServiceDescription(serviceName);
 
             /*
              * Input
@@ -197,9 +191,8 @@ public class GFacMessageReciever impleme
             ct.setOutput(outputParam);
 
             if (service == null) {
-                service = new PropertyServiceFactory().createService();
+                service = new PropertyServiceFactory(GFacService.REPOSITORY_PROPERTIES).createService();
             }
-            service.init();
             // invoke service
             service.execute(ct);
 
@@ -210,8 +203,9 @@ public class GFacMessageReciever impleme
             OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
             outputElement = fac.createOMElement("invokeResponse", omNs);
 
-            ParameterContextImpl paramContext = (ParameterContextImpl) ct.<AbstractParameter>getMessageContext("output");
-            for (Iterator<String> iterator = paramContext.getNames(); iterator.hasNext();
) {
+            ParameterContextImpl paramContext = (ParameterContextImpl) ct
+                    .<AbstractParameter> getMessageContext("output");
+            for (Iterator<String> iterator = paramContext.getNames(); iterator.hasNext();)
{
                 String name = iterator.next();
                 OMElement ele = fac.createOMElement(name, omNs);
                 ele.addAttribute("type", paramContext.getValue(name).getType().toString(),
omNs);
@@ -226,131 +220,131 @@ public class GFacMessageReciever impleme
         return outputElement;
     }
 
-    public void processgetWSDLOperation(MessageContext messageContext) throws Exception {
+    private void processgetWSDLOperation(MessageContext messageContext) throws Exception
{
         MessageContext response = null;
-        EndpointReference gfacUrl = messageContext.getConfigurationContext().getListenerManager().
-                getEPRforService("GFacService", "invoke", "http");
+        EndpointReference gfacUrl = messageContext.getConfigurationContext().getListenerManager()
+                .getEPRforService("GFacService", "invoke", "http");
         String serviceName = getOriginalServiceName(messageContext);
         String serviceEpr = gfacUrl.getAddress().split("GFacService")[0] + serviceName;
         ConfigurationContext context = messageContext.getConfigurationContext();
-        // todo this logic has to change based on the logic we are storing data
+        // TODO this logic has to change based on the logic we are storing data
         // into repository
         try {
-            Credentials credentials = (Credentials) context.getProperty("credentials");
-            Repository repo = (Repository) context.getProperty("repository");
-
-            JCRRegistry jcr = new JCRRegistry(repo, credentials);
-
-            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
-                    new StringReader(jcr.getWSDL(serviceName)));
-            StAXOMBuilder builder = new StAXOMBuilder(reader);
-            OMElement wsdlElement = builder.getDocumentElement();
+            OMElement wsdlElement = getWSDL(context, serviceName);
             XmlInfosetBuilder xmlInfosetBuilder = xsul.XmlConstants.BUILDER;
-            XmlDocument document = xmlInfosetBuilder.parseInputStream(
-                    new ByteArrayInputStream(wsdlElement.toString().getBytes()));
+            XmlDocument document = xmlInfosetBuilder.parseInputStream(new ByteArrayInputStream(wsdlElement.toString()
+                    .getBytes()));
             WsdlDefinitions definitions = new WsdlDefinitions(document.getDocumentElement());
             xsul5.wsdl.WsdlDefinitions definition5 = WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions);
             definition5 = xsul5.wsdl.WsdlUtil.createCWSDL(definition5, new URI(serviceEpr));
             definitions = WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(definition5);
-//            WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
-//            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(wsdlElement.toString().getBytes());
-//            InputSource source = new InputSource(byteArrayInputStream);
-//            Definition wsdlDefinition = wsdlReader.readWSDL(null, source);
-//
-//
-//            Map portTypes = wsdlDefinition.getPortTypes();
-//            Iterator portIt = portTypes.keySet().iterator();
-//            while(portIt.hasNext()){
-//                PortType portType = (PortType)portTypes.get(portIt.next());
-//                List operations = portType.getOperations();
-//                Iterator opIt = operations.iterator();
-//                String namespace = portType.getQName().getNamespaceURI();
-//
-//                Binding soap11binding = wsdlDefinition.createBinding();
-//                soap11binding.setQName(new QName(namespace,serviceName + "Soap11Binding"));
-//                soap11binding.setPortType(portType);
-//                while(opIt.hasNext()){
-//                    Operation operation = (Operation)opIt.next();
-//                    BindingOperation boperation = wsdlDefinition.createBindingOperation();
-//                    boperation.setName(operation.getName());
-//                    boperation.setOperation(operation);
-//                    soap11binding.addBindingOperation(boperation);
-//                }
-//
-//                opIt = operations.iterator();
-//                Binding soap12binding = wsdlDefinition.createBinding();
-//                soap12binding.setQName(new QName(namespace,serviceName + "Soap12Binding"));
-//                soap12binding.setPortType(portType);
-//                while(opIt.hasNext()){
-//                    Operation operation = (Operation)opIt.next();
-//                    BindingOperation boperation = wsdlDefinition.createBindingOperation();
-//                    boperation.setOperation(operation);
-//                    BindingInput input = wsdlDefinition.createBindingInput();
-//                    BindingOutput outpout = wsdlDefinition.createBindingOutput();
-//                    ExtensibilityElement element = new UnknownExtensibilityElement();
-//                    element.setElementType(new QName("http://schemas.xmlsoap.org/wsdl/soap12/","body"));
-//                    SOAP12BodyImpl body = new SOAP12BodyImpl()
-//                    input.addExtensibilityElement();
-//                    boperation.setBindingInput();
-//                    boperation.setName(operation.getName());
-//                    soap12binding.addBindingOperation(boperation);
-//                }
-//
-//                opIt = operations.iterator();
-//                Binding httpBinding = wsdlDefinition.create;
-//                httpBinding.setQName(new QName(namespace, serviceName + "httpBinding"));
-//                httpBinding.setPortType(portType);
-//                while(opIt.hasNext()){
-//                    Operation operation = (Operation)opIt.next();
-//                    BindingOperation boperation = wsdlDefinition.createBindingOperation();
-//                    boperation.setOperation(operation);
-//                    boperation.setName(operation.getName());
-//                    httpBinding.addBindingOperation(boperation);
-//                }
-//                wsdlDefinition.addBinding(soap11binding);
-//                wsdlDefinition.addBinding(soap12binding);
-//                wsdlDefinition.addBinding(httpBinding);
-//
-//                Port soap11port = wsdlDefinition.createPort();
-//                Port soap12port = wsdlDefinition.createPort();
-//                Port httpPort = wsdlDefinition.createPort();
-//
-//
-//                soap11port.setName(serviceName + "HttpSoap11Endpoint");
-//                soap12port.setName(serviceName + "HttpSoap12Endpoint");
-//                httpPort.setName(serviceName + "HttpEndpoint");
-//
-//                soap11port.setBinding(soap11binding);
-//                soap12port.setBinding(soap12binding);
-//                httpPort.setBinding(httpBinding);
-//
-//                Service service = wsdlDefinition.createService();
-//                service.setQName(new QName(namespace,serviceName));
-//                service.addPort(soap11port);
-//                service.addPort(soap12port);
-//                service.addPort(httpPort);
-//
-//                wsdlDefinition.addService(service);
-//                break;
-//            }
-//
-//            ByteArrayOutputStream out = new ByteArrayOutputStream();
-//            WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
-//            writer.writeWSDL(wsdlDefinition,out);
-//            out.toString();
-//            reader = XMLInputFactory.newInstance().createXMLStreamReader(
-//                    new StringReader(out.toString()));
-//            builder = new StAXOMBuilder(reader);
-//            wsdlElement = builder.getDocumentElement();
+            // WSDLReader wsdlReader =
+            // WSDLFactory.newInstance().newWSDLReader();
+            // ByteArrayInputStream byteArrayInputStream = new
+            // ByteArrayInputStream(wsdlElement.toString().getBytes());
+            // InputSource source = new InputSource(byteArrayInputStream);
+            // Definition wsdlDefinition = wsdlReader.readWSDL(null, source);
+            //
+            //
+            // Map portTypes = wsdlDefinition.getPortTypes();
+            // Iterator portIt = portTypes.keySet().iterator();
+            // while(portIt.hasNext()){
+            // PortType portType = (PortType)portTypes.get(portIt.next());
+            // List operations = portType.getOperations();
+            // Iterator opIt = operations.iterator();
+            // String namespace = portType.getQName().getNamespaceURI();
+            //
+            // Binding soap11binding = wsdlDefinition.createBinding();
+            // soap11binding.setQName(new QName(namespace,serviceName +
+            // "Soap11Binding"));
+            // soap11binding.setPortType(portType);
+            // while(opIt.hasNext()){
+            // Operation operation = (Operation)opIt.next();
+            // BindingOperation boperation =
+            // wsdlDefinition.createBindingOperation();
+            // boperation.setName(operation.getName());
+            // boperation.setOperation(operation);
+            // soap11binding.addBindingOperation(boperation);
+            // }
+            //
+            // opIt = operations.iterator();
+            // Binding soap12binding = wsdlDefinition.createBinding();
+            // soap12binding.setQName(new QName(namespace,serviceName +
+            // "Soap12Binding"));
+            // soap12binding.setPortType(portType);
+            // while(opIt.hasNext()){
+            // Operation operation = (Operation)opIt.next();
+            // BindingOperation boperation =
+            // wsdlDefinition.createBindingOperation();
+            // boperation.setOperation(operation);
+            // BindingInput input = wsdlDefinition.createBindingInput();
+            // BindingOutput outpout = wsdlDefinition.createBindingOutput();
+            // ExtensibilityElement element = new UnknownExtensibilityElement();
+            // element.setElementType(new
+            // QName("http://schemas.xmlsoap.org/wsdl/soap12/","body"));
+            // SOAP12BodyImpl body = new SOAP12BodyImpl()
+            // input.addExtensibilityElement();
+            // boperation.setBindingInput();
+            // boperation.setName(operation.getName());
+            // soap12binding.addBindingOperation(boperation);
+            // }
+            //
+            // opIt = operations.iterator();
+            // Binding httpBinding = wsdlDefinition.create;
+            // httpBinding.setQName(new QName(namespace, serviceName +
+            // "httpBinding"));
+            // httpBinding.setPortType(portType);
+            // while(opIt.hasNext()){
+            // Operation operation = (Operation)opIt.next();
+            // BindingOperation boperation =
+            // wsdlDefinition.createBindingOperation();
+            // boperation.setOperation(operation);
+            // boperation.setName(operation.getName());
+            // httpBinding.addBindingOperation(boperation);
+            // }
+            // wsdlDefinition.addBinding(soap11binding);
+            // wsdlDefinition.addBinding(soap12binding);
+            // wsdlDefinition.addBinding(httpBinding);
+            //
+            // Port soap11port = wsdlDefinition.createPort();
+            // Port soap12port = wsdlDefinition.createPort();
+            // Port httpPort = wsdlDefinition.createPort();
+            //
+            //
+            // soap11port.setName(serviceName + "HttpSoap11Endpoint");
+            // soap12port.setName(serviceName + "HttpSoap12Endpoint");
+            // httpPort.setName(serviceName + "HttpEndpoint");
+            //
+            // soap11port.setBinding(soap11binding);
+            // soap12port.setBinding(soap12binding);
+            // httpPort.setBinding(httpBinding);
+            //
+            // Service service = wsdlDefinition.createService();
+            // service.setQName(new QName(namespace,serviceName));
+            // service.addPort(soap11port);
+            // service.addPort(soap12port);
+            // service.addPort(httpPort);
+            //
+            // wsdlDefinition.addService(service);
+            // break;
+            // }
+            //
+            // ByteArrayOutputStream out = new ByteArrayOutputStream();
+            // WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
+            // writer.writeWSDL(wsdlDefinition,out);
+            // out.toString();
+            // reader = XMLInputFactory.newInstance().createXMLStreamReader(
+            // new StringReader(out.toString()));
+            // builder = new StAXOMBuilder(reader);
+            // wsdlElement = builder.getDocumentElement();
             // TODO based on the abstact wsdl content fill up the required
             // information using wsdl4j api
             SOAPFactory sf = OMAbstractFactory.getSOAP11Factory();
             SOAPEnvelope responseEnv = sf.createSOAPEnvelope();
             sf.createSOAPBody(responseEnv);
 
-            reader = XMLInputFactory.newInstance().createXMLStreamReader(
-                    new StringReader(definitions.toString()));
-            builder = new StAXOMBuilder(reader);
+            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new
StringReader(definitions.toString()));
+            StAXOMBuilder builder = new StAXOMBuilder(reader);
             responseEnv.getBody().addChild(builder.getDocumentElement());
             response = MessageContextBuilder.createOutMessageContext(messageContext);
             response.setEnvelope(responseEnv);
@@ -362,22 +356,14 @@ public class GFacMessageReciever impleme
         }
     }
 
-    public void processgetAbstractWSDLOperation(MessageContext messageContext) throws Exception
{
+    private void processgetAbstractWSDLOperation(MessageContext messageContext) throws Exception
{
         MessageContext response = null;
         String serviceName = getOriginalServiceName(messageContext);
         ConfigurationContext context = messageContext.getConfigurationContext();
-        // todo this logic has to change based on the logic we are storing data
+        // TODO this logic has to change based on the logic we are storing data
         // into repository
         try {
-            Credentials credentials = (Credentials) context.getProperty("credentials");
-            Repository repo = (Repository) context.getProperty("repository");
-
-            JCRRegistry jcr = new JCRRegistry(repo, credentials);
-
-            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
-                    new StringReader(jcr.getWSDL(serviceName)));
-            StAXOMBuilder builder = new StAXOMBuilder(reader);
-            OMElement wsdlElement = builder.getDocumentElement();
+            OMElement wsdlElement = getWSDL(context, serviceName);
             SOAPFactory sf = OMAbstractFactory.getSOAP11Factory();
             SOAPEnvelope responseEnv = sf.createSOAPEnvelope();
             sf.createSOAPBody(responseEnv);
@@ -392,6 +378,35 @@ public class GFacMessageReciever impleme
         }
     }
 
+    /**
+     * Get Abstract WSDL and build it as OMElement
+     * 
+     * @param context
+     * @param serviceName
+     * @return
+     * @throws XMLStreamException
+     */
+    private OMElement getWSDL(ConfigurationContext context, String serviceName) throws XMLStreamException{
+        String WSDL = getRegistry(context).getWSDL(serviceName);
+        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new
StringReader(WSDL));
+        StAXOMBuilder builder = new StAXOMBuilder(reader);
+        OMElement wsdlElement = builder.getDocumentElement();
+        return wsdlElement;
+    }
+    
+    /**
+     * Get Registry Object in the configuration context
+     * 
+     * @param context
+     * @return
+     */
+    private Axis2Registry getRegistry(ConfigurationContext context) {
+        if (this.registry == null) {
+            this.registry = (Axis2Registry) context.getProperty(GFacService.CONFIGURATION_CONTEXT_REGISTRY);
+        }
+        return registry;
+    }
+
     private String getOriginalServiceName(MessageContext messageContext) {
         String toAddress = messageContext.getTo().getAddress();
         String[] values = Utils.parseRequestURLForServiceAndOperation(toAddress, messageContext

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java?rev=1166931&r1=1166930&r2=1166931&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java
Thu Sep  8 22:33:16 2011
@@ -43,9 +43,7 @@ public enum GFacServiceOperations {
             if (status.toString().equalsIgnoreCase(s)) {
                 return status;
             }
-
         }
-
         throw new RuntimeException("invalid WsEventingOperation:- " + s);
     }
 }

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=1166931&r1=1166930&r2=1166931&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 Thu
Sep  8 22:33:16 2011
@@ -18,13 +18,27 @@
 # under the License.
 #
 #
+jcr.class=org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory
+org.apache.jackrabbit.repository.uri=http://localhost:8080/rmi
+jcr.user=admin
+jcr.pass=admin
 
-#repository.factory=org.wso2.carbon.registry.jcr.RegistryRepositoryFactory
-#registryUrl=https://localhost:9443/registry
-#certPath=/Users/lahirugunathilake/work/wso2greg-4.0.0/repository/resources/security/client-truststore.jks
-#trustStorePassword=wso2carbon
-#carbon.home=/Users/lahirugunathilake/work/wso2greg-4.0.0
-userName=admin
-password=admin
-repository.factory=org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory
-org.apache.jackrabbit.repository.uri=http://localhost:8081/rmi
+scheduler.class= org.apache.airavata.core.gfac.scheduler.impl.SchedulerImpl
+
+datachain.classes= org.apache.airavata.core.gfac.extension.data.RegistryDataService
+
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.GridFtpInputStaging 
+prechain.classes= org.apache.airavata.core.gfac.extension.pre.HttpInputStaging
+
+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



Mime
View raw message