Created
September 12, 2012 17:23
-
-
Save leviyehonatan/3708357 to your computer and use it in GitHub Desktop.
show usage of ThreadSafeClientConnManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
private <T> T createRestService(Class<T> clazz, String address) { | |
ClientConnectionManager cm = new ThreadSafeClientConnManager(); | |
HttpClient httpClient = new DefaultHttpClient(cm); | |
ClientExecutor executor = new ApacheHttpClient4Executor(httpClient); | |
return ProxyFactory.create(clazz, address, executor); | |
} | |
public void setInvokerAddress(String address) { | |
Invoker invoker = createRestService(Invoker.class, address)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment