Annotation Interface DisableDiscovery


@Retention(RUNTIME) @Target({TYPE,METHOD}) @Inherited public @interface DisableDiscovery
Whether discovery is automated or disabled. If discovery is desired, do not annotate test class with this annotation.

When discovery is enabled, the whole classpath is scanned for bean archives (jar files containing META-INF/beans.xml) and all beans and extensions are added automatically.

When discovery is disabled, CDI would only contain the CDI implementation itself and beans and extensions added through annotations AddBean and AddExtension If discovery is disabled on class level and desired on method level, the value can be set to false.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    By default if you annotate a class or a method, discovery gets disabled.
  • Element Details

    • value

      boolean value
      By default if you annotate a class or a method, discovery gets disabled. If you want to override configuration on method to differ from class, you can configure the value to false, effectively enabling discovery.
      Returns:
      whether to disable discovery (true), or enable it (false). If this annotation is not present, discovery is enabled
      Default:
      true