JAXB使用Woodstox解析器来提高性能? [英] JAXB to use Woodstox parser for performance?

查看:222
本文介绍了JAXB使用Woodstox解析器来提高性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以切换本机解析器,我相信它基于Java反射。我们遇到了一些性能问题,并想知道我们是否可以切换实施。

Is it possible switch the native parser, which I believe is based on Java reflection. We have some performance issues and wondering whether we can switch the implementation.

您的建议非常受欢迎。

附加信息:这是继承的代码,我们需要修复Web服务中的性能问题。我正在寻找性能提升而无需更改代码。现有代码使用JAXB来编组和解组通过CXF生成的java对象(wsdl到java)。

Additional information: This is inherited code and we need to fix performance issues in our web-services. I am looking for performance boost without code changes. The existing code uses JAXB for marshalling and unmarshalling java objects which are generated via CXF (wsdl to java).

我的目标是将实现切换为sTax,然后使用Woodstox库。

My goal is to switch the implementation to sTax and then use Woodstox library.

推荐答案

如果您的JAXB实现通过标准JAXP API使用StAX解析器,那么添加 Woodstox jar到你的类路径应该导致你的JAXB impl使用Woodstox。你应该看到这样做的性能提升。

If your JAXB implementation uses a StAX parser under the covers via the standard JAXP APIs, then adding the Woodstox jar to your classpath should cause your JAXB impl to use Woodstox. You should see a performance improvement by doing this.

Woodstox jar包含以下条目,将其添加到类路径将允许JAXP API返回它的实例:

Since the Woodstox jar contains the following entries, adding it to the classpath will allow the JAXP APIs to return an instance of it:


  • META -INF / services / javax.xml.stream.XMLInputFactory

  • META-INF / services / javax.xml.stream.XMLOuputFactory

注意:我带领 EclipseLink JAXB( MOXy),MOXy使用StAX解析器。其他JAXB实现(Metro,JaxMe)也可能做同样的事情。

Note: I lead EclipseLink JAXB (MOXy), and MOXy uses a StAX parser when one is available. The other JAXB implementations (Metro, JaxMe) probably do the same thing.

这篇关于JAXB使用Woodstox解析器来提高性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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