axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r374719 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: deployment/util/Utils.java description/AxisMessage.java
Date Fri, 03 Feb 2006 18:25:02 GMT
Author: chinthaka
Date: Fri Feb  3 10:24:28 2006
New Revision: 374719

URL: http://svn.apache.org/viewcvs?rev=374719&view=rev
Log:
Adding an improved util method to create a service. 

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java?rev=374719&r1=374718&r2=374719&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
Fri Feb  3 10:24:28 2006
@@ -212,7 +212,7 @@
      * @return return created AxisSrevice
      */
     public static AxisService createService(String implClass,
-                                            AxisConfiguration axisConfig) throws AxisFault
{
+                                            AxisConfiguration axisConfig, Class messageReceiverClass)
throws AxisFault {
         Parameter parameter = new ParameterImpl(Constants.SERVICE_CLASS, implClass);
         AxisService axisService = new AxisService();
         axisService.setUseDefaultChains(false);
@@ -254,17 +254,13 @@
 
             // loading message recivers
             try {
-                Class clazz = Class.forName("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
-                MessageReceiver messageReceiver = (MessageReceiver) clazz.newInstance();
+                MessageReceiver messageReceiver = (MessageReceiver) messageReceiverClass.newInstance();
                 operation.setMessageReceiver(messageReceiver);
-            } catch (ClassNotFoundException e) {
-                throw new AxisFault("ClassNotFoundException occurd during message receiver
loading"
-                        + e.getMessage());
             } catch (IllegalAccessException e) {
-                throw new AxisFault("IllegalAccessException occurd during message receiver
loading"
+                throw new AxisFault("IllegalAccessException occured during message receiver
loading"
                         + e.getMessage());
             } catch (InstantiationException e) {
-                throw new AxisFault("InstantiationException occurd during message receiver
loading"
+                throw new AxisFault("InstantiationException occured during message receiver
loading"
                         + e.getMessage());
             }
 
@@ -272,6 +268,20 @@
             axisService.addOperation(operation);
         }
         return axisService;
+
+    }
+
+    public static AxisService createService(String implClass,
+                                            AxisConfiguration axisConfig) throws AxisFault
{
+        Class clazz;
+        try {
+            clazz = Class.forName("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
+        } catch (ClassNotFoundException e) {
+             throw new AxisFault("ClassNotFoundException occured during message receiver
loading"
+                        + e.getMessage());
+        }
+
+        return createService(implClass, axisConfig, clazz);
 
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java?rev=374719&r1=374718&r2=374719&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
Fri Feb  3 10:24:28 2006
@@ -94,6 +94,7 @@
     public XmlSchemaElement getSchemaElement() {
         AxisService service = (AxisService) getParent().getParent();
         XmlSchema schema = service.getSchema();
+
         if (schema != null) {
             Iterator scheamItms = schema.getItems().getIterator();
             while (scheamItms.hasNext()) {



Mime
View raw message