【问题标题】:Is unmarshalling thread safe?解组线程安全吗?
【发布时间】:2014-09-09 15:12:27
【问题描述】:

我正在使用方法

javax.xml.bind.Unmarshaller.unmarshal(Source source, Class<RX> declaredType) 

并且想知道这个方法是否是线程安全的。否则我将不得不在每次调用时实例化一个 Unmarshaller

【问题讨论】:

    标签: soap jaxb thread-safety


    【解决方案1】:

    Unmarshaller.unmarshal 不是线程安全的。

    发件人:https://javaee.github.io/jaxb-v2/doc/user-guide/ch03.html#other-miscellaneous-topics-performance-and-thread-safety

    JAXBContext 类是线程安全的,但是 Marshaller, Unmarshaller 和 Validator 类不是线程安全的。

    【讨论】:

    • 谢谢。现在我想知道是否可以将一个模式对象附加到同时工作的多个解组器。
    猜你喜欢
    • 1970-01-01
    • 2021-12-23
    • 2020-04-15
    • 2011-07-04
    • 2014-04-26
    • 2012-11-30
    • 2010-12-30
    • 2013-03-12
    • 2021-08-03
    相关资源
    最近更新 更多