You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2003/03/28 18:09:07 UTC

cvs commit: xml-axis/java/src/org/apache/axis/description ServiceDesc.java

dims        2003/03/28 09:09:07

  Modified:    java/src/org/apache/axis/description ServiceDesc.java
  Log:
  Fix for Bug 18474 - [JAX-RPC] WSDL should not contain ServiceLifeCycle's methods
  
  Revision  Changes    Path
  1.73      +34 -1     xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
  
  Index: ServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- ServiceDesc.java	19 Feb 2003 13:37:31 -0000	1.72
  +++ ServiceDesc.java	28 Mar 2003 17:09:07 -0000	1.73
  @@ -836,6 +836,39 @@
       }
   
       /**
  +     * Is this method from ServiceLifeCycle interface?
  +     * @param m
  +     * @return true if this method is from ServiceLifeCycle interface
  +     */ 
  +    private boolean isServiceLifeCycleMethod(Class implClass, Method m) {
  +        if(javax.xml.rpc.server.ServiceLifecycle.class.isAssignableFrom(implClass)) {
  +            String methodName = m.getName(); 
  +
  +            if(methodName.equals("init")) {
  +                // Check if the method signature is 
  +                // "public abstract void init(Object context) throws ServiceException;"
  +                Class[] classes = m.getParameterTypes(); 
  +                if(classes != null && 
  +                   classes.length == 1 && 
  +                   classes[0] == Object.class && 
  +                   m.getReturnType() == Void.TYPE) {
  +                    return true;
  +                }
  +            } else if (methodName.equals("destroy")){
  +                // Check if the method signature is 
  +                // "public abstract void destroy();"
  +                Class[] classes = m.getParameterTypes(); 
  +                if(classes != null && 
  +                   classes.length == 0 &&
  +                   m.getReturnType() == Void.TYPE) {
  +                    return true;
  +                }
  +            }
  +        }
  +        return false;
  +    }
  +    
  +    /**
        * Recursive helper class for loadServiceDescByIntrospection
        */
       private void loadServiceDescByIntrospectionRecursive(Class implClass)
  @@ -847,7 +880,7 @@
           Method [] methods = implClass.getDeclaredMethods();
   
           for (int i = 0; i < methods.length; i++) {
  -            if (Modifier.isPublic(methods[i].getModifiers())) {
  +            if (Modifier.isPublic(methods[i].getModifiers()) && !isServiceLifeCycleMethod(implClass, methods[i])) {
                   getSyncedOperationsForName(implClass, methods[i].getName());
               }
           }