public final class JAXRSClientFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
create(String baseAddress,
Class<T> cls)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
ClassLoader loader)
Creates a proxy using a custom class loader
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers,
boolean threadSafe)
Creates a thread safe proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers,
List<Feature> features,
String configLocation)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers,
long timeToKeepState)
Creates a thread safe proxy and allows to specify time to keep state.
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers,
String configLocation)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
List<?> providers,
String username,
String password,
String configLocation)
Creates a proxy which will do basic authentication
|
static <T> T |
create(String baseAddress,
Class<T> cls,
String configLocation)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
String configLocation,
Object... varValues)
Creates a proxy
|
static <T> T |
create(String baseAddress,
Class<T> cls,
String username,
String password,
String configLocation)
Creates a proxy which will do basic authentication
|
static <T> T |
create(URI baseURI,
Class<T> cls)
Creates a proxy
|
static <T> T |
create(URI baseURI,
Class<T> cls,
boolean inheritHeaders)
Creates a proxy
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
List<UserResource> modelBeans,
List<?> providers,
String configLocation)
Creates a proxy using user resource model
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
List<UserResource> modelBeans,
String configLocation)
Creates a proxy using user resource model
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
String modelRef,
List<?> providers,
boolean threadSafe)
Creates a thread safe proxy using user resource model
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
String modelRef,
List<?> providers,
long timeToKeepState)
Creates a thread safe proxy using user resource model and allows to
specify time to keep state.
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
String modelRef,
List<?> providers,
String configLocation)
Creates a proxy using user resource model
|
static <T> T |
createFromModel(String baseAddress,
Class<T> cls,
String modelRef,
String configLocation)
Creates a proxy using user resource model
|
static <T> T |
fromClient(Client client,
Class<T> cls)
Creates a proxy, baseURI will be set to Client currentURI
|
static <T> T |
fromClient(Client client,
Class<T> cls,
boolean inheritHeaders)
Creates a proxy, baseURI will be set to Client currentURI
|
public static <T> T create(String baseAddress, Class<T> cls)
baseAddress - baseAddresscls - resource class, if not interface then a CGLIB proxy will be createdpublic static <T> T create(String baseAddress, Class<T> cls, ClassLoader loader)
baseAddress - baseAddressloader - class loadercls - resource class, if not interface then a CGLIB proxy will be createdpublic static <T> T create(URI baseURI, Class<T> cls)
baseURI - baseURIcls - resource class, if not interface then a CGLIB proxy will be createdpublic static <T> T create(URI baseURI, Class<T> cls, boolean inheritHeaders)
baseURI - baseURIcls - resource class, if not interface then a CGLIB proxy will be createdinheritHeaders - if true then existing proxy headers will be inherited by
subresource proxies if anypublic static <T> T create(String baseAddress, Class<T> cls, String configLocation)
baseAddress - baseAddresscls - resource class, if not interface then a CGLIB proxy will be createdconfigLocation - classpath location of the configuration resourcepublic static <T> T create(String baseAddress, Class<T> cls, String configLocation, Object... varValues)
baseAddress - baseAddresscls - 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}"configLocation - classpath location of the configuration resourcevarValues - values to replace root Path template variablespublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providerspublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers, boolean threadSafe)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providersthreadSafe - if true then a thread-safe proxy will be createdpublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers, long timeToKeepState)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providerstimeToKeepState - how long to keep this statepublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providersconfigLocation - classpath location of the configuration resourcepublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers, List<Feature> features, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providersfeatures - the features which will be applied to the clientconfigLocation - classpath location of the configuration resourcepublic static <T> T create(String baseAddress, Class<T> cls, String username, String password, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdusername - usernamepassword - passwordconfigLocation - classpath location of the configuration resourcepublic static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String username, String password, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdproviders - list of providersusername - usernamepassword - passwordconfigLocation - classpath location of the configuration resourcepublic static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelRef - model locationpublic static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelRef - model locationproviders - list of providersconfigLocation - classpath location of the configuration resourcepublic static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, boolean threadSafe)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelRef - model locationproviders - list of providersthreadSafe - if true then thread-safe proxy will be createdpublic static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, long timeToKeepState)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelRef - model locationproviders - list of providerstimeToKeepState - how long to keep this statepublic static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelBeans - model beansconfigLocation - classpath location of the configuration resourcepublic static <T> T createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, List<?> providers, String configLocation)
baseAddress - baseAddresscls - proxy class, if not interface then a CGLIB proxy will be createdmodelBeans - model beansproviders - list of providersconfigLocation - classpath location of the configuration resourcepublic static <T> T fromClient(Client client, Class<T> cls)
client - Client instancecls - proxy class, if not interface then a CGLIB proxy will be createdpublic static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders)
client - Client instancecls - proxy class, if not interface then a CGLIB proxy will be createdinheritHeaders - if true then existing Client headers will be inherited by new proxy
and subresource proxies if anyApache CXF