How do we get a reference to beans / resources in a subclass of org.apache.cxf.phase.AbstractPhaseInterceptor?

Solution Verified - Updated -

Issue

  • There are CXF interceptors (subclasses of org.apache.cxf.phase.AbstractPhaseInterceptor<Message>) that are being applied to a web service.
  • Ideally, users would like to @Inject beans and resources into the interceptors. However, it appears that the interceptor instances used by CXF are not CDI managed beans and so do not have CDI injection.
  • Is there a good / proper / reasonable way to get beans and references in these interceptors?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.