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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content