What is the substitue for Resteasy ProxyFactory class

不打扰是莪最后的温柔 提交于 2019-12-22 04:29:29

问题


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); 

回答1:


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);


来源:https://stackoverflow.com/questions/17858714/what-is-the-substitue-for-resteasy-proxyfactory-class

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!