axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r454819 - /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Date Tue, 10 Oct 2006 16:44:51 GMT
Author: deepal
Date: Tue Oct 10 09:44:50 2006
New Revision: 454819

URL: http://svn.apache.org/viewvc?view=rev&rev=454819
Log:
forget to commit to branch

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=454819&r1=454818&r2=454819
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Tue Oct 10 09:44:50 2006
@@ -25,7 +25,9 @@
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.ServiceLifeCycle;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.Loader;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -116,6 +118,22 @@
                     service.setTargetNamespace(Java2WSDLConstants.DEFAULT_TARGET_NAMESPACE);
                 }
             }
+            //Processing service lifecycle attribute
+            OMAttribute serviceLifeCycleClass = service_element.
+                    getAttribute(new QName(TAG_CLASS_NAME));
+            if (serviceLifeCycleClass != null) {
+                String className = serviceLifeCycleClass.getAttributeValue();
+                if (className != null) {
+                    try {
+                        ClassLoader loader = service.getClassLoader();
+                        Class serviceLifeCycleClassImpl = Loader.loadClass(loader, className);
+                        service.setServiceLifeCycle(
+                                (ServiceLifeCycle) serviceLifeCycleClassImpl.newInstance());
+                    } catch (Exception e) {
+                        throw new DeploymentException(e.getMessage(), e);
+                    }
+                }
+            }
             //Setting schema namespece if any
             OMElement schemaElement = service_element.getFirstChildWithName(new QName(SCHEMA));
             if (schemaElement != null) {
@@ -237,6 +255,13 @@
                     try {
                         if (generateWsdl(service)) {
                             Utils.fillAxisService(service, axisConfig, excludeops);
+                        } else {
+                            ArrayList nonRpcOperations = getNonPRCMethods(service);
+                            for (int i = 0; i < excludeops.size(); i++) {
+                                String opName = (String) excludeops.get(i);
+                                nonRpcOperations.add(opName);
+                                Utils.fillAxisService(service, axisConfig, nonRpcOperations);
+                            }
                         }
                     } catch (Exception e) {
                         /**
@@ -292,13 +317,44 @@
                 if (!("org.apache.axis2.rpc.receivers.RPCMessageReceiver"
                         .equals(messageReceiverClass)
                         || "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
-                        .equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
+                        .equals(messageReceiverClass)
+                        || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
                         .equals(messageReceiverClass))) {
                     return false;
                 }
             }
         }
         return true;
+    }
+
+    /**
+     * To get the methods which dose not use RPC* Message Recievers
+     *
+     * @return
+     */
+    private ArrayList getNonPRCMethods(AxisService axisService) {
+        ArrayList excludeOperations = new ArrayList();
+        Iterator operatins = axisService.getOperations();
+        if (operatins.hasNext()) {
+            while (operatins.hasNext()) {
+                AxisOperation axisOperation = (AxisOperation) operatins
+                        .next();
+                if (axisOperation.getMessageReceiver() == null) {
+                    continue;
+                }
+                String messageReceiverClass = axisOperation
+                        .getMessageReceiver().getClass().getName();
+                if (!("org.apache.axis2.rpc.receivers.RPCMessageReceiver"
+                        .equals(messageReceiverClass)
+                        || "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"
+                        .equals(messageReceiverClass)
+                        || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver"
+                        .equals(messageReceiverClass))) {
+                    excludeOperations.add(axisOperation.getName().getLocalPart());
+                }
+            }
+        }
+        return excludeOperations;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message