Author: sergeyb Date: Tue May 29 13:29:28 2012 New Revision: 1343715 URL: http://svn.apache.org/viewvc?rev=1343715&view=rev Log: Merged revisions 1343663 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
................ r1343663 | sergeyb | 2012-05-29 11:54:44 +0100 (Tue, 29 May 2012) | 9 lines Merged revisions 1343661 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1343661 | sergeyb | 2012-05-29 11:51:31 +0100 (Tue, 29 May 2012) | 1 line [CXF-4345] Adding a single method accepting the list of features to JAXRSClientFactory and WebClient, also removing references to Spring in JavaDocs ........ ................ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/branches/2.5.x-fixes:r1343663 Merged /cxf/trunk:r1343661 Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java?rev=1343715&r1=1343714&r2=1343715&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java (original) +++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactory.java Tue May 29 13:29:28 2012 @@ -68,22 +68,8 @@ public final class JAXRSClientFactory { * @return typed proxy */ public static <T> T create(URI baseURI, Class<T> cls, boolean inheritHeaders) { - return create(baseURI, cls, inheritHeaders, null); - } - - /** - * Creates a proxy - * @param baseURI baseURI - * @param cls resource class, if not interface then a CGLIB proxy will be created - * @param inheritHeaders if true then existing proxy headers will be inherited by - * subresource proxies if any - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T create(URI baseURI, Class<T> cls, boolean inheritHeaders, List<AbstractFeature> features) { JAXRSClientFactoryBean bean = getBean(baseURI.toString(), cls, null); bean.setInheritHeaders(inheritHeaders); - bean.setFeatures(features); return bean.create(cls); } @@ -91,7 +77,7 @@ public final class JAXRSClientFactory { * Creates a proxy * @param baseAddress baseAddress * @param cls resource class, if not interface then a CGLIB proxy will be created - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T create(String baseAddress, Class<T> cls, String configLocation) { @@ -103,42 +89,9 @@ public final class JAXRSClientFactory { * Creates a proxy * @param baseAddress baseAddress * @param cls resource class, if not interface then a CGLIB proxy will be created - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T create(String baseAddress, Class<T> cls, String configLocation, - List<AbstractFeature> features) { - JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation); - bean.setFeatures(features); - return bean.create(cls); - } - - /** - * Creates a proxy - * @param baseAddress baseAddress - * @param cls resource class, if not interface then a CGLIB proxy will be created * This class is expected to have a root JAXRS Path annotation containing * template variables, for ex, "/path/{id1}/{id2}" - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client - * @param varValues values to replace root Path template variables - * @return typed proxy - */ - public static <T> T create(String baseAddress, Class<T> cls, String configLocation, - List<AbstractFeature> features, Object... varValues) { - JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation); - bean.setFeatures(features); - return bean.create(cls, varValues); - } - - /** - * Creates a proxy - * @param baseAddress baseAddress - * @param cls resource class, if not interface then a CGLIB proxy will be created - * This class is expected to have a root JAXRS Path annotation containing - * template variables, for ex, "/path/{id1}/{id2}" - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @param varValues values to replace root Path template variables * @return typed proxy */ @@ -169,26 +122,11 @@ public final class JAXRSClientFactory { * @return typed proxy */ public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, boolean threadSafe) { - return create(baseAddress, cls, providers, threadSafe, null); - } - - /** - * Creates a thread safe proxy - * @param baseAddress baseAddress - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param providers list of providers - * @param threadSafe if true then a thread-safe proxy will be created - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, boolean threadSafe, - List<AbstractFeature> features) { JAXRSClientFactoryBean bean = getBean(baseAddress, cls, null); bean.setProviders(providers); if (threadSafe) { bean.setInitialState(new ThreadLocalClientState(baseAddress)); } - bean.setFeatures(features); return bean.create(cls); } @@ -197,11 +135,13 @@ public final class JAXRSClientFactory { * @param baseAddress baseAddress * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String configLocation) { - return create(baseAddress, cls, providers, configLocation); + JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation); + bean.setProviders(providers); + return bean.create(cls); } /** @@ -209,12 +149,13 @@ public final class JAXRSClientFactory { * @param baseAddress baseAddress * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client + * @param features the features which will be applied to the client + * @param configLocation classpath location of the configuration resource * @return typed proxy */ - public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String configLocation, - List<AbstractFeature> features) { + public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, + List<AbstractFeature> features, + String configLocation) { JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation); bean.setProviders(providers); bean.setFeatures(features); @@ -227,30 +168,14 @@ public final class JAXRSClientFactory { * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param username username * @param password password - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T create(String baseAddress, Class<T> cls, String username, String password, String configLocation) { - return create(baseAddress, cls, username, password, configLocation); - } - - /** - * Creates a proxy which will do basic authentication - * @param baseAddress baseAddress - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param username username - * @param password password - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T create(String baseAddress, Class<T> cls, String username, - String password, String configLocation, List<AbstractFeature> features) { JAXRSClientFactoryBean bean = getBean(baseAddress, cls, configLocation); bean.setUsername(username); bean.setPassword(password); - bean.setFeatures(features); return bean.create(cls); } @@ -272,31 +197,15 @@ public final class JAXRSClientFactory { * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param modelRef model location * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, String configLocation) { - return createFromModel(baseAddress, cls, modelRef, providers, configLocation, null); - } - - /** - * Creates a proxy using user resource model - * @param baseAddress baseAddress - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param modelRef model location - * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, - List<?> providers, String configLocation, List<AbstractFeature> features) { JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, configLocation); bean.setProviders(providers); bean.setModelRef(modelRef); bean.setServiceClass(cls); - bean.setFeatures(features); return bean.create(cls); } @@ -311,20 +220,6 @@ public final class JAXRSClientFactory { */ public static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, boolean threadSafe) { - return createFromModel(baseAddress, cls, modelRef, providers, threadSafe, null); - } - - /** - * Creates a thread safe proxy using user resource model - * @param baseAddress baseAddress - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param modelRef model location - * @param providers list of providers - * @param threadSafe if true then thread-safe proxy will be created - * @return typed proxy - */ - public static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, - List<?> providers, boolean threadSafe, List<AbstractFeature> features) { JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, null); bean.setProviders(providers); bean.setModelRef(modelRef); @@ -332,7 +227,6 @@ public final class JAXRSClientFactory { if (threadSafe) { bean.setInitialState(new ThreadLocalClientState(baseAddress)); } - bean.setFeatures(features); return bean.create(cls); } @@ -341,7 +235,7 @@ public final class JAXRSClientFactory { * @param baseAddress baseAddress * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param modelBeans model beans - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, @@ -355,32 +249,16 @@ public final class JAXRSClientFactory { * @param cls proxy class, if not interface then a CGLIB proxy will be created * @param modelBeans model beans * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource + * @param configLocation classpath location of the configuration resource * @return typed proxy */ public static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, List<?> providers, String configLocation) { - return createFromModel(baseAddress, cls, modelBeans, providers, configLocation); - } - - /** - * Creates a proxy using user resource model - * @param baseAddress baseAddress - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param modelBeans model beans - * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, - List<?> providers, String configLocation, List<AbstractFeature> features) { JAXRSClientFactoryBean bean = WebClient.getBean(baseAddress, configLocation); bean.setProviders(providers); bean.setModelBeans(modelBeans); bean.setServiceClass(cls); - bean.setFeatures(features); return bean.create(cls); } @@ -404,23 +282,8 @@ public final class JAXRSClientFactory { * @return typed proxy */ public static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders) { - return fromClient(client, cls, inheritHeaders, null); - } - - /** - * Creates a proxy, baseURI will be set to Client currentURI - * @param client Client instance - * @param cls proxy class, if not interface then a CGLIB proxy will be created - * @param inheritHeaders if true then existing Client headers will be inherited by new proxy - * and subresource proxies if any - * @param features, the features which will be applied to the client - * @return typed proxy - */ - public static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders, - List<AbstractFeature> features) { JAXRSClientFactoryBean bean = getBean(client.getCurrentURI().toString(), cls, null); bean.setInheritHeaders(inheritHeaders); - bean.setFeatures(features); ClientState clientState = WebClient.getClientState(client); Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1343715&r1=1343714&r2=1343715&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original) +++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Tue May 29 13:29:28 2012 @@ -42,6 +42,7 @@ import javax.xml.stream.XMLStreamWriter; import org.apache.cxf.Bus; import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.feature.AbstractFeature; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor; import org.apache.cxf.interceptor.Fault; @@ -129,10 +130,10 @@ public class WebClient extends AbstractC } /** - * Creates a Spring-configuration aware WebClient + * Creates WebClient * @param baseAddress baseAddress * @param providers list of providers - * @param configLocation classpath location of Spring configuration resource, can be null + * @param configLocation classpath location of the configuration resource, can be null * @return WebClient instance */ public static WebClient create(String baseAddress, List<?> providers, String configLocation) { @@ -142,9 +143,27 @@ public class WebClient extends AbstractC } /** - * Creates a Spring-configuration aware WebClient + * Creates WebClient with a list of custom features + * @param baseAddress baseAddress + * @param providers list of providers + * @param features the features which will be applied to the client + * @param configLocation classpath location of the configuration resource, can be null + * @return WebClient instance + */ + public static WebClient create(String baseAddress, + List<?> providers, + List<AbstractFeature> features, + String configLocation) { + JAXRSClientFactoryBean bean = getBean(baseAddress, configLocation); + bean.setProviders(providers); + bean.setFeatures(features); + return bean.createWebClient(); + } + + /** + * Creates WebClient * @param baseAddress baseAddress - * @param configLocation classpath location of Spring configuration resource, can be null + * @param configLocation classpath location of the configuration resource, can be null * @return WebClient instance */ public static WebClient create(String baseAddress, String configLocation) { @@ -154,11 +173,11 @@ public class WebClient extends AbstractC } /** - * Creates a Spring-configuration aware WebClient which will do basic authentication + * Creates WebClient which will do basic authentication * @param baseAddress baseAddress * @param username username * @param password password - * @param configLocation classpath location of Spring configuration resource, can be null + * @param configLocation classpath location of the configuration resource, can be null * @return WebClient instance */ public static WebClient create(String baseAddress, String username, String password,
