8

我刚刚意识到ProxyFactory该类在 RestEasy 3.0.0 版中被标记为已弃用。遗憾的是,弃用此类的方法在任何地方都没有记录。我曾经以这种方式初始化我的服务,但新的方式是什么?

protected static final String URL = "http://localhost:12345"+"/api";
protected static final MyService myService = ProxyFactory.create(MyService.class, URL); 
4

1 回答 1

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);
于 2013-09-11T14:34:40.737 回答