axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/client Service.java Stub.java
Date Mon, 25 Apr 2005 20:54:26 GMT
dims        2005/04/25 13:54:26

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
               java/src/org/apache/axis/client Service.java Stub.java
  Log:
  try to make tomj happy :)
  
  - reinstate the working of getCall() in service. (with explicit javadoc about thread safety)
  - remove my HACK and store last _call in o.a.a.c.Stub in the new _createCall method.
  
  Revision  Changes    Path
  1.147     +1 -3      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- JavaStubWriter.java	18 Apr 2005 17:17:12 -0000	1.146
  +++ JavaStubWriter.java	25 Apr 2005 20:54:26 -0000	1.147
  @@ -267,9 +267,7 @@
           pw.println(
                   "    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException
{");
           pw.println("        try {");
  -        pw.println("            org.apache.axis.client.Call _call =");
  -        pw.println(
  -                "                    (org.apache.axis.client.Call) super.service.createCall();");
  +        pw.println("            org.apache.axis.client.Call _call = super._createCall();");
           pw.println("            if (super.maintainSessionSet) {");
           pw.println(
                   "                _call.setMaintainSession(super.maintainSession);");
  
  
  
  1.109     +10 -5     ws-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/client/Service.java,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- Service.java	22 Apr 2005 13:59:29 -0000	1.108
  +++ Service.java	25 Apr 2005 20:54:26 -0000	1.109
  @@ -82,6 +82,9 @@
       private static HashMap cachedWSDL = new HashMap();
       private static boolean cachingWSDL = true;
   
  +    // The last call object
  +    protected Call _call = null;
  +
       /**
        * A Hashtable mapping addresses (URLs) to Transports (objects)
        */
  @@ -541,8 +544,8 @@
        * @throws ServiceException If there's an error
        */
       public javax.xml.rpc.Call createCall() throws ServiceException {
  -        Call call = new org.apache.axis.client.Call(this);
  -        return call;
  +        _call = new org.apache.axis.client.Call(this);
  +        return _call;
       }
   
       /**
  @@ -823,12 +826,14 @@
       }
   
       /**
  -     * Returns last Call object associated with
  -     * this service.
  +     * Returns last Call object associated with this service. Note that since
  +     * the Service is not thread-safe, you may not get the last call object
  +     * that you created on this thread. please use Stub._getCall
  +     *
        * @deprecated please use Stub._getCall
        */
       public Call getCall() throws ServiceException {
  -        throw new ServiceException(Messages.getMessage("useStubsGetCallMethod"));
  +        return _call;
       }
   
       /**
  
  
  
  1.42      +15 -6     ws-axis/java/src/org/apache/axis/client/Stub.java
  
  Index: Stub.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/client/Stub.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Stub.java	22 Apr 2005 13:59:29 -0000	1.41
  +++ Stub.java	25 Apr 2005 20:54:26 -0000	1.42
  @@ -23,6 +23,7 @@
   import javax.xml.namespace.QName;
   import javax.xml.rpc.JAXRPCException;
   import javax.xml.rpc.Service;
  +import javax.xml.rpc.ServiceException;
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.util.Iterator;
  @@ -65,7 +66,7 @@
       private boolean firstCall = true;
   
       // The last call object
  -    private Call _call = null;
  +    protected Call _call = null;
   
       /**
        * Is this the first time the type mappings are being registered?
  @@ -395,9 +396,6 @@
       }
   
       protected void setRequestHeaders(org.apache.axis.client.Call call) throws AxisFault
{        
  -        // HACK: store the _call object.
  -        _call = call;
  -
           // Set the call headers.
           SOAPHeaderElement[] headers = getHeaders();
           for(int i=0;i<headers.length;i++){
  @@ -430,8 +428,19 @@
       }
   
       /**
  -     * Returns last Call object associated with
  -     * this stub.
  +     * Creates a call from the service.
  +     * @return
  +     */
  +    public Call _createCall() throws ServiceException {
  +        _call = (Call) service.createCall();
  +
  +        // TODO: There is a lot of code in the generated stubs that
  +        // can be moved here.
  +        return _call;
  +    }
  +
  +    /**
  +     * Returns last Call object associated with this stub.
        */
       public Call _getCall() {
           return _call;
  
  
  

Mime
View raw message