You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2010/04/12 04:55:41 UTC

[jira] Commented: (CXF-2758) org.apache.cxf.frontend.ClientFactoryBean optimization

    [ https://issues.apache.org/jira/browse/CXF-2758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855817#action_12855817 ] 

Daniel Kulp commented on CXF-2758:
----------------------------------


The problem with that approach is that changes to the Endpoint state would then be shared across all the clients returned from the factory.   For example, the Endpoint is an InterceptorProvider.   Thus, any interceptors added to the endpoint for a client would affect all clients.

There MAY be an option to do some sort of optimized clone of an endpoint that could share SOME of the stuff, yet keep states separate.  Might be a bit tricky though.   

> org.apache.cxf.frontend.ClientFactoryBean optimization
> ------------------------------------------------------
>
>                 Key: CXF-2758
>                 URL: https://issues.apache.org/jira/browse/CXF-2758
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.3
>            Reporter: Rolf Thunbo
>            Priority: Minor
>
> In the create method both the endpoint and client is created each time it is called. Is it really neccessary to build the endpoint each time, wouldn't it be good enough to just create a new client based on the endpoint? Doing so greatly improves the performance of the client factory on subsequent calls to the create method.
> I propose the existing code be replaced by the following code:
> 	public Client create() {
> 		if (ep == null) {
> 			getServiceFactory().reset();
> 			if (getServiceFactory().getProperties() == null) {
> 				getServiceFactory().setProperties(properties);
> 			} else if (properties != null) {
> 				getServiceFactory().getProperties().putAll(properties);
> 			}
> 			try {
> 				ep = createEndpoint();
> 				applyProperties(ep);
> 				initializeAnnotationInterceptors(ep, getServiceClass());
> 			} catch (EndpointException e) {
> 				throw new ServiceConstructionException(e);
> 			} catch (BusException e) {
> 				throw new ServiceConstructionException(e);
> 			}
> 		}
> 		Client client = null;
> 		client = createClient(ep);
> 		applyFeatures(client);
> 		return client;
> 	}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira