axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MIGUEL ANTUNES (ATX-Arquitectura T├ęcnica) <micantu...@bes.pt>
Subject Question about org.apache.axis.description.JavaServiceDesc class
Date Thu, 18 Dec 2003 09:51:47 GMT
Hi,

I have a question about the way org.apache.axis.description.JavaServiceDesc
class initializes its operation descriptions through introspection:
 
Should overload methods defined in the service super class be found by the
introspection process even when StopClasses property is set?

My problem is that I do not want them to be found, I only want to expose the
operations that correspond to the methods declrared in the service class.
I've tried defining my own RPCProvider extension so that I could set the
StopClasses  property but that didn't worked. Then I looked into the
JavaServiceDesc  implementation and found that the StopClasses  property is
not checked when looking for overloaded methods in the super class. So I
changed the 
createOperationsForName so that it checks StopClasses  when looking for
overloading methods. Here is the code after my modification:

    private void createOperationsForName(Class implClass, String methodName)
    {
        // If we're a Skeleton deployment, skip the statics.
        if (isSkeletonClass) {
            if (methodName.equals("getOperationDescByName") ||
                methodName.equals("getOperationDescs"))
                return;
        }

        Method [] methods = implClass.getDeclaredMethods();

        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            if (Modifier.isPublic(method.getModifiers()) &&
                    method.getName().equals(methodName)) {
                createOperationForMethod(method);
            }
        }

	Class superClass = implClass.getSuperclass();
        if (superClass != null &&
                !superClass.getName().startsWith("java.") &&
                !superClass.getName().startsWith("javax.")&&
		(stopClasses == null ||
		!stopClasses.contains(superClass.getName())))
//<------------------------------- added check for stop classes
	{
            createOperationsForName(superClass, methodName);
        }

    }  

I have made this change in Axis 1.1 and  now in Axis 1.2 alpha and to avoid
any further changes in future Axis versions, I would like to know if this is
the intended behavior, and if it is, could  Axis at least provide some kind
of service configuration parameter to turn off overloaded methods discovery;
or perhaps could org.apache.axis.handlers.soap.SOAPService define a factory
method for creating ServiceDesc instances that could be overridden in
subclasses to allow JavaServiceDesc extensions???


Best regards,
Miguel Antunes




Mime
View raw message