cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Giger <gigerst...@gmx.ch>
Subject HttpConduit thread safety
Date Fri, 06 Feb 2009 18:17:55 GMT
Hi,

Is the following code (copied from the user-docs) thread safe?

import org.apache.cxf.endpoint.Client;
  import org.apache.cxf.frontend.ClientProxy;
  import org.apache.cxf.transport.http.HTTPConduit;
  import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
  ...

  URL wsdl = getClass().getResource("wsdl/greeting.wsdl");
  SOAPService service = new SOAPService(wsdl, serviceName);
  Greeter greeter = service.getPort(portName, Greeter.class);

  // Okay, are you sick of configuration files ?
  // This will show you how to configure the http conduit dynamically
  Client client = ClientProxy.getClient(greeter);
  HTTPConduit http = (HTTPConduit) client.getConduit();

  HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();

  httpClientPolicy.setConnectionTimeout(36000);
  httpClientPolicy.setAllowChunking(false);
  httpClientPolicy.setReceiveTimeout(32000);

  http.setClient(httpClientPolicy);

  ...
  greeter.sayHi("Hello");


Not that I have found any issue with it, but I want to
be sure that it's intended to be.

The requirement is to invoke multiple Endpoints in parallel where
every EP has its own configuration (SSL-Client-Authentication,
timeouts, url, expect-100-continue, etc). The whole configuration
must be made at runtime, because the EP aren't known at startup time.

Thank you!

Marc

Mime
View raw message