You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Pär Malmqvist <pa...@hotmail.com> on 2007/11/16 16:22:36 UTC

wsdl2java client threadsafe?

Hello,
do you know if a client generated by the wsdl2java tool is said to be thread safe?I am using Axis2 1.3.
 
/Pär Malmqvist
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE

Re: wsdl2java client threadsafe?

Posted by Martin Gainty <mg...@hotmail.com>.
Thread parameters are configurable on Server-side via axis2.xml
      <!-- Here is the complete list of supported parameters (see example settings further below):
            port: the port to listen on (default 6060)
            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
                                false to minimize bandwidth consumption by combining segments
            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
                                       note that default queue never fills up:  see HttpFactory
            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
                                  note that no such threads can exist with default unbounded request queue
            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
        -->

On the client side the closest to a asynchronous invocation is /userguide/clients/EchoNonBlockingDualClient
            //Callback to handle the response
            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    System.out.println(result.getResponseEnvelope());
                }

                public void onError(Exception e) {
                    e.printStackTrace();
                }
            };

            //Non-Blocking Invocation
            sender = new ServiceClient();
            sender.engageModule(Constants.MODULE_ADDRESSING);
            sender.setOptions(options);
            sender.sendReceiveNonBlocking(payload, callback);

            //Wait till the callback receives the response.
            while (!callback.isComplete()) {
                Thread.sleep(1000);
            }

As you can see the communications are asynchronous but are not truly Threadable as there is no accomodation for 
ThreadLocal attributes and 
the methods are not synchronized

Does this help?
Martin--
  ----- Original Message ----- 
  From: Pär Malmqvist 
  To: axis-user@ws.apache.org 
  Sent: Friday, November 16, 2007 10:22 AM
  Subject: wsdl2java client threadsafe?


  Hello,
  do you know if a client generated by the wsdl2java tool is said to be thread safe?
  I am using Axis2 1.3.
   
  /Pär Malmqvist


------------------------------------------------------------------------------
  Discover the new Windows Vista Learn more!