axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertlazar...@apache.org
Subject svn commit: r417108 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
Date Mon, 26 Jun 2006 02:03:33 GMT
Author: robertlazarski
Date: Sun Jun 25 19:03:32 2006
New Revision: 417108

URL: http://svn.apache.org/viewvc?rev=417108&view=rev
Log:
message receiver refactoring per jira AXIS2-751

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java?rev=417108&r1=417107&r2=417108&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
Sun Jun 25 19:03:32 2006
@@ -30,8 +30,11 @@
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.i18n.Messages;
 
+import java.lang.reflect.Method;
+
 public abstract class AbstractMessageReceiver implements MessageReceiver {
     public static final String SERVICE_CLASS = "ServiceClass";
+    public static final String SERVICE_OBJECT = "ServiceObject";
     public static final String SCOPE = "scope";
 
     /**
@@ -46,6 +49,15 @@
             AxisService service =
                     msgContext.getOperationContext().getServiceContext().getAxisService();
             ClassLoader classLoader = service.getClassLoader();
+            // allow alternative definition of makeNewServiceObject
+            if (service.getParameter(SERVICE_OBJECT) != null) {
+               Parameter serviceObjectParam = service.getParameter(SERVICE_OBJECT);
+               Class serviceObjectMaker = Class.forName(((String) 
+                        serviceObjectParam.getValue()).trim(), true, classLoader);
+               Method method = serviceObjectMaker.getMethod("makeNewServiceObject",
+                        new Class[] { MessageContext.class });
+               return method.invoke(serviceObjectMaker.newInstance(), new Object[] { msgContext
});
+            }
             Parameter implInfoParam = service.getParameter(SERVICE_CLASS);
 
             if (implInfoParam != null) {



---------------------------------------------------------------------
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