You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2011/08/12 05:25:19 UTC
svn commit: r1156950 - in /incubator/airavata/trunk: ./
modules/gfac-axis2-artifacts/ modules/gfac-axis2-artifacts/src/
modules/gfac-axis2-artifacts/src/main/
modules/gfac-axis2-artifacts/src/main/java/
modules/gfac-axis2-artifacts/src/main/java/org/ m...
Author: lahiru
Date: Fri Aug 12 03:25:19 2011
New Revision: 1156950
URL: http://svn.apache.org/viewvc?rev=1156950&view=rev
Log:
adding gfac-axis2-artifact module and gfac-axis2 modification with a message Reciever
Added:
incubator/airavata/trunk/modules/gfac-axis2-artifacts/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/pom.xml
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/GFacURIBasedDispatcher.java
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/
incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/services.xml
incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/
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/utils/GFacServiceOperations.java
Modified:
incubator/airavata/trunk/modules/gfac-axis2/pom.xml
incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/services.xml
incubator/airavata/trunk/modules/gfac-core/pom.xml
incubator/airavata/trunk/pom.xml
Added: incubator/airavata/trunk/modules/gfac-axis2-artifacts/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2-artifacts/pom.xml?rev=1156950&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2-artifacts/pom.xml (added)
+++ incubator/airavata/trunk/modules/gfac-axis2-artifacts/pom.xml Fri Aug 12 03:25:19 2011
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (theà "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY ~ KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>airavata</groupId>
+ <artifactId>airavata-axis2-artifacts</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>GFac-Axis2-Artifacts</name>
+ <description>Axis2 Artifacts for Gfac funcationality</description>
+ <properties>
+ <org.slf4j.version>1.6.1</org.slf4j.version>
+ <log4j.version>1.2.16</log4j.version>
+ <axis2.version>1.5.1</axis2.version>
+ <axiom.version>1.2.8</axiom.version>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2</artifactId>
+ <version>${axis2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ <version>${axiom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-impl</artifactId>
+ <version>${axiom.version}</version>
+ </dependency>
+ </dependencies>
+<build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/lib</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/GFacURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/GFacURIBasedDispatcher.java?rev=1156950&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/GFacURIBasedDispatcher.java (added)
+++ incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/java/org/apache/airavata/axis2/artifacts/dispatchers/GFacURIBasedDispatcher.java Fri Aug 12 03:25:19 2011
@@ -0,0 +1,93 @@
+package org.apache.airavata.axis2.artifacts.dispatchers;
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+import com.sun.corba.se.spi.activation.Server;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.WSDL2Constants;
+import org.apache.axis2.dispatchers.AbstractServiceDispatcher;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.Handler.InvocationResponse;
+import org.apache.axis2.engine.Handler;
+import org.apache.axis2.util.LoggingControl;
+import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+public class GFacURIBasedDispatcher extends AbstractServiceDispatcher {
+
+ public static final String NAME = "GFacURIBasedDispatcher";
+ private static final Log log = LogFactory.getLog(GFacURIBasedDispatcher.class);
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
+ */
+ public AxisService findService(MessageContext messageContext) throws AxisFault {
+ EndpointReference toEPR = messageContext.getTo();
+ if (toEPR != null) {
+ if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+ log.debug(messageContext.getLogIDString() +
+ " Checking for Service using target endpoint address : " +
+ toEPR.getAddress());
+ }
+ String filePart = toEPR.getAddress();
+ ConfigurationContext configurationContext = messageContext.getConfigurationContext();
+ String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
+ messageContext.getConfigurationContext().getServiceContextPath());
+ AxisConfiguration registry =
+ configurationContext.getAxisConfiguration();
+
+ if ((values.length >= 1) && (values[0] != null)) {
+ AxisService service = registry.getService(values[0]);
+ if (service == null) {
+ service = registry.getService("GFacService");
+ if(service != null){
+ if ("getWSDL".equals(values[1]) || "invoke".equals(values[1])) {
+ if (service != null) {
+ //todo get the wsdl from registry and add the endpoints to messagecontext
+ messageContext.setAxisService(service);
+ messageContext.setAxisOperation(
+ service.getOperation(new QName("getWSDL")));
+ } else {
+ log.error("GFacService is not deployed, Please deploy the GFac service or double check the service name");
+ }
+ return service;
+ }}else{
+ log.error("GfacService is not deployed");
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public void initDispatcher() {
+ init(new HandlerDescription(NAME));
+ }
+}
Added: incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/services.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/services.xml?rev=1156950&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/services.xml (added)
+++ incubator/airavata/trunk/modules/gfac-axis2-artifacts/src/main/resources/services.xml Fri Aug 12 03:25:19 2011
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (theà "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY ~ KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+
+<service name="GfacService">
+ <Description>
+ Gfac contact point
+ </Description>
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </messageReceivers>
+ <parameter name="ServiceClass" locked="false">org.apache.airavata.services.gfac.axis2.GFacService</parameter>
+</service>
Modified: incubator/airavata/trunk/modules/gfac-axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/pom.xml?rev=1156950&r1=1156949&r2=1156950&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/pom.xml (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/pom.xml Fri Aug 12 03:25:19 2011
@@ -14,8 +14,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>GFac</groupId>
- <artifactId>GFac-Axis2-Interface</artifactId>
+ <groupId>airavata</groupId>
+ <artifactId>airavata-gfac-axis2-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GFac-Axis2-Interface</name>
<description>Axis2 Interface to the GFac-Core</description>
@@ -42,8 +42,8 @@
<version>${axiom.version}</version>
</dependency>
<dependency>
- <groupId>Airavata</groupId>
- <artifactId>GFac-Core</artifactId>
+ <groupId>airavata</groupId>
+ <artifactId>gfac-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
Added: 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=1156950&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java (added)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java Fri Aug 12 03:25:19 2011
@@ -0,0 +1,52 @@
+package org.apache.airavata.services.gfac.axis2.reciever;
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+import org.apache.airavata.services.gfac.axis2.utils.GFacServiceOperations;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.receivers.AbstractMessageReceiver;
+import org.apache.axis2.util.MessageContextBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class GFacMessageReciever implements MessageReceiver {
+
+ private static final Log log = LogFactory.getLog(GFacMessageReciever.class);
+
+ public void receive(org.apache.axis2.context.MessageContext axisRequestMsgCtx)
+ throws AxisFault {
+ GFacServiceOperations operation = GFacServiceOperations.valueFrom(axisRequestMsgCtx.getOperationContext().getOperationName());
+ switch (operation) {
+ case INVOKE: {
+ log.info("Invoke operation invoked !!");
+ }
+ break;
+ case GETWSDL: {
+ log.info("getWSDL operation invoked !!");
+ }
+ }
+ }
+
+}
Added: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/utils/GFacServiceOperations.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/utils/GFacServiceOperations.java?rev=1156950&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/utils/GFacServiceOperations.java (added)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/utils/GFacServiceOperations.java Fri Aug 12 03:25:19 2011
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.services.gfac.axis2.utils;
+
+public enum GFacServiceOperations {
+
+ GETWSDL("getWSDL"), INVOKE("invoke");
+
+ private final String name;
+
+ private GFacServiceOperations(String n) {
+ name = n;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ public boolean equals(String s) {
+ return name.equals(s);
+ }
+
+ public static GFacServiceOperations valueFrom(String s) {
+ for (GFacServiceOperations status : GFacServiceOperations.values()) {
+ if (status.toString().equalsIgnoreCase(s)) {
+ return status;
+ }
+
+ }
+
+ throw new RuntimeException("invalid WsEventingOperation:- " + s);
+ }
+}
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/services.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/services.xml?rev=1156950&r1=1156949&r2=1156950&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/services.xml (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/resources/services.xml Fri Aug 12 03:25:19 2011
@@ -11,13 +11,24 @@
OF ANY ~ KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
-<service name="GfacService">
- <Description>
- Gfac contact point
- </Description>
- <messageReceivers>
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
- </messageReceivers>
- <parameter name="ServiceClass" locked="false">org.apache.airavata.services.gfac.axis2.GFacService</parameter>
-</service>
+
+<serviceGroup>
+ <service name="GFacService" class="org.apache.airavata.services.gfac.axis2.GFacService">
+ <Description>Gfac contact point</Description>
+ <operation name="getWSDL">
+ <messageReceiver class="org.apache.airavata.services.gfac.axis2.reciever.GFacMessageReciever"/>
+ <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
+ </actionMapping>
+ <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
+ </outputActionMapping>
+ </operation>
+ <operation name="invoke">
+ <messageReceiver class="org.apache.airavata.services.gfac.axis2.reciever.GFacMessageReciever"/>
+
+ <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
+ </actionMapping>
+ <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
+ </outputActionMapping>
+ </operation>
+ </service>
+</serviceGroup>
Modified: incubator/airavata/trunk/modules/gfac-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/pom.xml?rev=1156950&r1=1156949&r2=1156950&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/pom.xml (original)
+++ incubator/airavata/trunk/modules/gfac-core/pom.xml Fri Aug 12 03:25:19 2011
@@ -15,7 +15,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>airavata</groupId>
- <artifactId>GFac-Core</artifactId>
+ <artifactId>gfac-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GFac-Core</name>
<description>The core GFAC functionality independent from any webservice implementation. </description>
Modified: incubator/airavata/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/pom.xml?rev=1156950&r1=1156949&r2=1156950&view=diff
==============================================================================
--- incubator/airavata/trunk/pom.xml (original)
+++ incubator/airavata/trunk/pom.xml Fri Aug 12 03:25:19 2011
@@ -78,6 +78,7 @@
<modules>
<module>modules/gfac-core</module>
<module>modules/gfac-axis2</module>
+ <module>modules/gfac-axis2-artifacts</module>
<module>modules/commons</module>
</modules>
</profile>
@@ -141,8 +142,8 @@
<module>modules/xregistry</module>
<module>modules/gfac-core</module>
<module>modules/gfac-axis2</module>
+ <module>modules/gfac-axis2-artifacts</module>
<module>modules/ws-messenger</module>
- <module>modules/workflow-interpreter</module>
<module>modules/xbaya-gui</module>
<module>modules/commons</module>
</modules>