|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.resteasy.client.spring.RestClientProxyFactoryBean<T>
T
- The type representing the client interface.public class RestClientProxyFactoryBean<T>
FactoryBean
to generate a client
proxy from a REST annotated interface.
Example: The following spring xml configuration snippet makes a bean with the id echoClient. The bean is a generated proxy of the a.b.c.Echo interface to access the remote service on http://server.far.far.away:8080/echo base URI.
<bean id="echoClient" class="org.jboss.resteasy.client.spring.RestClientProxyFactoryBean" p:serviceInterface="a.b.c.Echo" p:baseUri="http://server.far.far.away:8080/echo" />
Constructor Summary | |
---|---|
RestClientProxyFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
URI |
getBaseUri()
|
ClientExecutor |
getClientExecutor()
|
org.apache.http.client.HttpClient |
getHttpClient()
|
T |
getObject()
|
Class<T> |
getObjectType()
|
ResteasyProviderFactory |
getResteasyProviderFactory()
|
Class<T> |
getServiceInterface()
|
boolean |
isSingleton()
|
void |
setBaseUri(URI baseUri)
This is a mandatory property that needs to be set. |
void |
setClientExecutor(ClientExecutor clientExecutor)
Optional property for advanced usage. |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Optional property. |
void |
setResteasyProviderFactory(ResteasyProviderFactory resteasyProviderFactory)
Optional property for advanced usage. |
void |
setServiceInterface(Class<T> serviceInterface)
This is a mandatory property that needs to be set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestClientProxyFactoryBean()
Method Detail |
---|
public T getObject() throws Exception
Exception
public Class<T> getObjectType()
public boolean isSingleton()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public Class<T> getServiceInterface()
public void setServiceInterface(Class<T> serviceInterface)
serviceInterface
- the interface for which a proxy is needed to be generated.public URI getBaseUri()
public void setBaseUri(URI baseUri)
baseUri
- the remote service base address.public org.apache.http.client.HttpClient getHttpClient()
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
clientExecutor
is
null, this will be used by proxy generation. This could be useful for
example when you want to use a
ThreadSafeClientConnManager
instead of a
SingleClientConnManager
which
is the default in HttpClient
.
httpClient
- the instance to be used by proxy generationProxyFactory#create(Class, URI, HttpClient, ResteasyProviderFactory)
public ClientExecutor getClientExecutor()
public void setClientExecutor(ClientExecutor clientExecutor)
httpClient
property is ignored.
clientExecutor
- the instance to be used by proxy generationProxyFactory.create(Class, URI, ClientExecutor,
ResteasyProviderFactory)
public ResteasyProviderFactory getResteasyProviderFactory()
public void setResteasyProviderFactory(ResteasyProviderFactory resteasyProviderFactory)
resteasyProviderFactory
- the instance to be used by proxy generation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |