如何使用CDI 1.0从扫描中排除类

Ale*_*e T 10 java-ee cdi weld weblogic12c

我想在CDI 1.0中排除扫描类.我在WebLogic 12.1.12(Weld,CDI 1.0)中使用CDI的默认实现.

我看到了几个带有CDI 1.1的网站和文档,但没有使用之前的版本.

Har*_*ann 9

使用Weld,您可以使用自定义XML命名空间beans.xml从扫描中排除类:

 <beans xmlns="http://java.sun.com/xml/ns/javaee" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:weld="http://jboss.org/schema/weld/beans">
   <weld:scan>
     <weld:exclude name="com.acme.swing.**"/>
   </weld:scan>
 </beans>
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅焊接手册.