axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/client Call.java Stub.java
Date Mon, 29 Jul 2002 12:42:12 GMT
butek       2002/07/29 05:42:12

  Modified:    java/src/javax/xml/rpc Call.java
               java/src/org/apache/axis/client Call.java Stub.java
  Log:
  Call/Stub changed to be JAX-RPC compliant (note that they are still NOT
  JAX-RPC TCK compliant, but that's another issue).
  
  - the constant for Call.SESSION_MAINTAIN_PROPERTY was wrong.
  - set/getProperty method exceptions should be JAXRPCException, not
  IllegalArgumentException.
  - set/getProperty methods ONLY throw an exception IFF the property
  starts with "javax." or "java." AND it's not in the accepted property list.
  
  Revision  Changes    Path
  1.15      +1 -1      xml-axis/java/src/javax/xml/rpc/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/javax/xml/rpc/Call.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Call.java	16 Jun 2002 19:36:55 -0000	1.14
  +++ Call.java	29 Jul 2002 12:42:12 -0000	1.15
  @@ -135,7 +135,7 @@
        * <p>Type: <code>java.lang.Boolean</code>
        */
       public static final String SESSION_MAINTAIN_PROPERTY =
  -        "javax.xml.rpc.http.session.maintain";
  +        "javax.xml.rpc.session.maintain";
   
       /**
        * Indicates whether <code>addParameter</code> and
  
  
  
  1.162     +27 -21    xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.161
  retrieving revision 1.162
  diff -u -r1.161 -r1.162
  --- Call.java	24 Jul 2002 18:01:04 -0000	1.161
  +++ Call.java	29 Jul 2002 12:42:12 -0000	1.162
  @@ -295,13 +295,13 @@
        */
       public void setProperty(String name, Object value) {
           if (name == null || value == null) {
  -            throw new IllegalArgumentException(
  +            throw new JAXRPCException(
                       JavaUtils.getMessage(name == null ?
                                            "badProp03" : "badProp04"));
           }
           else if (name.equals(USERNAME_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -309,7 +309,7 @@
           }
           else if (name.equals(PASSWORD_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -317,7 +317,7 @@
           }
           else if (name.equals(SESSION_MAINTAIN_PROPERTY)) {
               if (!(value instanceof Boolean)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.Boolean",
  @@ -327,7 +327,7 @@
           }
           else if (name.equals(OPERATION_STYLE_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -335,7 +335,7 @@
           }
           else if (name.equals(SOAPACTION_USE_PROPERTY)) {
               if (!(value instanceof Boolean)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.Boolean",
  @@ -345,7 +345,7 @@
           }
           else if (name.equals(SOAPACTION_URI_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.String",
  @@ -355,7 +355,7 @@
           }
           else if (name.equals(ENCODINGSTYLE_URI_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.String",
  @@ -365,7 +365,7 @@
           }
           else if (name.equals(Stub.ENDPOINT_ADDRESS_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.String",
  @@ -375,7 +375,7 @@
           }
           else if ( name.equals(TRANSPORT_NAME) ) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -385,19 +385,19 @@
           }
           else if ( name.equals(ATTACHMENT_ENCAPSULATION_FORMAT) ) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
               if(!value.equals(ATTACHMENT_ENCAPSULATION_FORMAT_MIME ) && 
                  !value.equals(ATTACHMENT_ENCAPSULATION_FORMAT_DIME ))
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badattachmenttypeerr", new String[] {
                           (String) value, ATTACHMENT_ENCAPSULATION_FORMAT_MIME + " "
                           +ATTACHMENT_ENCAPSULATION_FORMAT_DIME  }));
           }
  -        else {
  -            throw new IllegalArgumentException(
  +        else if (name.startsWith("java.") || name.startsWith("javax.")) {
  +            throw new JAXRPCException(
                       JavaUtils.getMessage("badProp05", name));
           }
           callProperties.put(name, value);
  @@ -407,13 +407,14 @@
        * Returns the value associated with the named property
        *
        * @return Object value of the property or null if the property is not set
  -     * @throws IllegalArgumentException if the requested property is not a supported property
  +     * @throws JAXRPCException if the requested property is not a supported property
        */
       public Object getProperty(String name) {
  -        if (name == null || !isPropertySupported(name))
  -            throw new IllegalArgumentException(name == null ?
  +        if (name == null || !isPropertySupported(name)) {
  +            throw new JAXRPCException(name == null ?
                     JavaUtils.getMessage("badProp03") :
                     JavaUtils.getMessage("badProp05", name));
  +        }
           return callProperties.get(name);
       } // getProperty
   
  @@ -423,13 +424,17 @@
         * @param name name of the property to remove
         */
        public void removeProperty(String name) {
  -         if ( name == null || callProperties == null ) return ;
  -         callProperties.remove( name );
  +         if (name == null || !isPropertySupported(name)) {
  +            throw new JAXRPCException(name == null ?
  +                  JavaUtils.getMessage("badProp03") :
  +                  JavaUtils.getMessage("badProp05", name));
  +         }
  +         callProperties.remove(name);
        } // removeProperty
   
       public void setScopedProperty(String name, Object value) {
           if (name == null || value == null) {
  -            throw new IllegalArgumentException(
  +            throw new JAXRPCException(
                       JavaUtils.getMessage(name == null ?
                                            "badProp03" : "badProp04"));
           }
  @@ -470,7 +475,8 @@
       }
   
       public boolean isPropertySupported(String name) {
  -        return propertyNames.contains(name);
  +        return propertyNames.contains(name) || !name.startsWith("java.")
  +               || !name.startsWith("javax.");
       }
   
       /**
  
  
  
  1.14      +15 -6     xml-axis/java/src/org/apache/axis/client/Stub.java
  
  Index: Stub.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Stub.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Stub.java	8 Jul 2002 16:37:37 -0000	1.13
  +++ Stub.java	29 Jul 2002 12:42:12 -0000	1.14
  @@ -63,6 +63,7 @@
   
   import javax.xml.namespace.QName;
   
  +import javax.xml.rpc.JAXRPCException;
   import javax.xml.rpc.Service;
   
   import org.apache.axis.AxisFault;
  @@ -123,13 +124,13 @@
        */
       public void _setProperty(String name, Object value) {
           if (name == null || value == null) {
  -            throw new IllegalArgumentException(
  +            throw new JAXRPCException(
                       JavaUtils.getMessage(name == null ?
                                            "badProp03" : "badProp04"));
           }
           else if (name.equals(Call.USERNAME_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -137,7 +138,7 @@
           }
           else if (name.equals(Call.PASSWORD_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -145,7 +146,7 @@
           }
           else if (name.equals(Stub.ENDPOINT_ADDRESS_PROPERTY)) {
               if (!(value instanceof String)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[] {
                           name, "java.lang.String", value.getClass().getName()}));
               }
  @@ -153,12 +154,12 @@
                   cachedEndpoint = new URL ((String) value);
               }
               catch (MalformedURLException mue) {
  -                throw new IllegalArgumentException(mue.getMessage());
  +                throw new JAXRPCException(mue.getMessage());
               }
           }
           else if (name.equals(Call.SESSION_MAINTAIN_PROPERTY)) {
               if (!(value instanceof Boolean)) {
  -                throw new IllegalArgumentException(
  +                throw new JAXRPCException(
                           JavaUtils.getMessage("badProp00", new String[]
                           {name,
                           "java.lang.Boolean",
  @@ -167,6 +168,10 @@
               maintainSessionSet = true;
               maintainSession = ((Boolean) value).booleanValue();
           }
  +        else if (name.startsWith("java.") || name.startsWith("javax.")) {
  +            throw new JAXRPCException(
  +                    JavaUtils.getMessage("badProp05", name));
  +        }
           else {
               cachedProperties.put(name, value);
           }
  @@ -192,6 +197,10 @@
               }
               else if (name.equals(Call.SESSION_MAINTAIN_PROPERTY)) {
                   return maintainSessionSet ? new Boolean(maintainSession) : null;
  +            }
  +            else if (name.startsWith("java.") || name.startsWith("javax.")) {
  +                throw new JAXRPCException(
  +                        JavaUtils.getMessage("badProp05", name));
               }
               else {
                   return cachedProperties.get(name);
  
  
  

Mime
View raw message