I have read that sharing a single JAXBContext object across multiple threads can greatly reduce the CPU usage of an application that uses JAXB. A proof of this is here. We are currently using Apache CXF for developing web services. Apache CXF is bound to use JAXB by default.

  • According to this, Apache CXF can be configured to use a single instance of JAXBContext through a configuration file.
  • According to this, we can supply a configuration file to CXF. This configuration file is a Spring configuration file.
  • According to this, Apache CXF can be used without Spring.

Given the above information, how do I configure Apache CXF to use a single JAXBContext without using a Spring based configuration file since I am looking at a code base that uses the servlet transport without Spring? Are there any other configuration parameters that can be added for the JAXBContext that will further improve the performance?

Edit
Report