8

I just realized that the ProxyFactory class is marked deprecated in RestEasy version 3.0.0. Sadly the approach that deprecates this class is not documented anywhere. I used to initialize my services this way but what is the new way?

protected static final String URL = "http://localhost:12345"+"/api";
protected static final MyService myService = ProxyFactory.create(MyService.class, URL); 
allprog
  • 16,540
  • 9
  • 56
  • 97
  • I found this [link](http://docs.jboss.org/resteasy/docs/3.0.2.Final/userguide/html/RESTEasy_Client_Framework.html#d4e2076). Section 46.2 seems to answer your question, does it? – Laf Jul 25 '13 at 13:14
  • 1
    Would be good but those classes don't exist in Resteasy 3.0.0. The JAXRS API 3.0.0 is also added but that has only a ClientBuilder and I can't get a proxy out of it. – allprog Jul 25 '13 at 13:42

1 Answers1

13

RESTEasy 3.0.2.Final ( http://howtodoinjava.com/2013/08/03/jax-rs-2-0-resteasy-3-0-2-final-client-api-example/ )

ResteasyClient client = new ResteasyClientBuilder().build();

ResteasyWebTarget target = client.target(URL);

MyService myService = target.proxy(MyService .class);
bummi
  • 27,123
  • 14
  • 62
  • 101
pico633
  • 146
  • 1
  • 3
  • 3
    Is this thread-safe?? what about in this case?? String url = "http://localhost:12345"+"/api"; MyService myService = ProxyFactory.create(MyService.class, url, clientExecutor); – avillagomez Jan 29 '14 at 19:46