Resteasy ProxyFactory类的替代品是什么? [英] What is the substitue for Resteasy ProxyFactory class

查看:282
本文介绍了Resteasy ProxyFactory类的替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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


推荐答案

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

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

这篇关于Resteasy ProxyFactory类的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆