congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BeforeBeanDiscovery
Code IndexAdd Tabnine to your IDE (free)

How to use
BeforeBeanDiscovery
in
javax.enterprise.inject.spi

Best Java code snippets using javax.enterprise.inject.spi.BeforeBeanDiscovery (Showing top 20 results out of 909)

Refine searchRefine arrow

  • Observes
  • BeanManager
  • VetoedSuppressedAnnotatedType
origin: jersey/jersey

  @SuppressWarnings("unused")
  private void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery beforeBeanDiscovery, final javax.enterprise.inject.spi
      .BeanManager beanManager) {
    beforeBeanDiscovery.addAnnotatedType(beanManager.createAnnotatedType(WebAppExceptionHolder.class));
    beforeBeanDiscovery.addAnnotatedType(beanManager.createAnnotatedType(WebAppExceptionInterceptor.class));
    beforeBeanDiscovery.addAnnotatedType(beanManager.createAnnotatedType(TransactionalExceptionMapper.class));
  }
}
origin: wildfly/wildfly

  public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager manager) {
    event.addScope(ViewScoped.class, true, true);
  }
}
origin: oracle/helidon

/**
 * Adds interceptor bindings and annotated types.
 *
 * @param discovery Event information.
 * @param bm Bean manager instance.
 */
void registerInterceptorBindings(@Observes BeforeBeanDiscovery discovery, BeanManager bm) {
  // Check if fault tolerance and its metrics are enabled
  final Config config = ConfigProvider.getConfig();
  isFaultToleranceEnabled = config.getOptionalValue(MP_FT_NON_FALLBACK_ENABLED, Boolean.class)
      .orElse(true);      // default is enabled
  isFaultToleranceMetricsEnabled = config.getOptionalValue(MP_FT_METRICS_ENABLED, Boolean.class)
      .orElse(true);      // default is enabled
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Retry.class)));
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(CircuitBreaker.class)));
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Timeout.class)));
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Asynchronous.class)));
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Bulkhead.class)));
  discovery.addInterceptorBinding(new InterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Fallback.class)));
  discovery.addAnnotatedType(bm.createAnnotatedType(CommandInterceptor.class), CommandInterceptor.class.getName());
}
origin: weld/core

void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) {
  event.addAnnotatedType(VetoedSuppressedAnnotatedType.from(ActivateRequestContextInterceptor.class, beanManager),
      ActivateRequestContextInterceptor.class.getName());
  event.addAnnotatedType(VetoedSuppressedAnnotatedType.from(CdiRequestContextActivatorInterceptor.class, beanManager),
      CdiRequestContextActivatorInterceptor.class.getName());
}
origin: org.jboss.narayana.jta/cdi

public void register(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {        
  
  bbd.addScope(TransactionScoped.class, true, true);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorMandatory.class), TransactionalInterceptorMandatory.class.getName() + TX_INTERCEPTOR);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorNever.class), TransactionalInterceptorNever.class.getName() + TX_INTERCEPTOR);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorNotSupported.class), TransactionalInterceptorNotSupported.class.getName() + TX_INTERCEPTOR);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorRequired.class), TransactionalInterceptorRequired.class.getName() + TX_INTERCEPTOR);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorRequiresNew.class), TransactionalInterceptorRequiresNew.class.getName() + TX_INTERCEPTOR);
  bbd.addAnnotatedType(bm.createAnnotatedType(TransactionalInterceptorSupports.class), TransactionalInterceptorSupports.class.getName() + TX_INTERCEPTOR);
}
origin: org.glassfish.main.web/web-sse

@SuppressWarnings("UnusedDeclaration")
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
  bbd.addQualifier(ServerSentEventContext.class);
}
origin: oracle/helidon

/**
 * Initializes the extension prior to bean discovery.
 *
 * @param discovery bean discovery event
 */
public void before(@Observes BeforeBeanDiscovery discovery) {
  // Register beans manually
  discovery.addAnnotatedType(JsonWebTokenProducer.class, "TokenProducer");
}
origin: tomitribe/microscoped

public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd) {
  bbd.addScope(TimerScoped.class, true, false);
  bbd.addInterceptorBinding(TimerScopeEnabled.class);
}
origin: org.jboss.cdi.tck/cdi-tck-impl

public void addQualifierByAnnotatedType(@Observes BeforeBeanDiscovery beforeBeanDiscovery, BeanManager beanManager) {
  setObserved(true);
  // add @Skill(language(); @Nonbinding level()) as qualifier
  beforeBeanDiscovery.addQualifier(new AnnotatedTypeWrapper<Skill>(beanManager.createAnnotatedType(Skill.class), true) {
    Set<AnnotatedMethod<? super Skill>> methods;
    {
      methods = new HashSet<AnnotatedMethod<? super Skill>>();
      for (final AnnotatedMethod<? super Skill> method : super.getMethods()) {
        if ("level".equals(method.getJavaMember().getName())) {
          methods.add(new AnnotatedMethodWrapper<Skill>((AnnotatedMethod<Skill>) method, this, true,
              new AnnotationLiteral<Nonbinding>() {
              }));
        } else {
          methods.add(new AnnotatedMethodWrapper<Skill>((AnnotatedMethod<Skill>) method, this, true));
        }
      }
    }
    @Override
    public Set<AnnotatedMethod<? super Skill>> getMethods() {
      return methods;
    }
  });
}
origin: org.jboss.cdi.tck/cdi-tck-impl

public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, final BeanManager beanManager)
    throws SecurityException, NoSuchMethodException {
  event.addInterceptorBinding(Incremented.class);
  event.addInterceptorBinding(FullMarathon.class);
  event.addInterceptorBinding(new AnnotatedTypeWrapper<Suffixed>(beanManager.createAnnotatedType(Suffixed.class), true) {
    Set<AnnotatedMethod<? super Suffixed>> methods;
origin: org.jsr107.ri/cache-annotations-ri-cdi

/**
 * Service interface implemented by extensions. An extension is a service provider declared in META-INF/services.
 *
 * @param beforeBeanDiscoveryEvent the event to register
 */
void discoverInterceptorBindings(@Observes BeforeBeanDiscovery beforeBeanDiscoveryEvent) {
 beforeBeanDiscoveryEvent.addInterceptorBinding(CachePut.class);
 beforeBeanDiscoveryEvent.addInterceptorBinding(CacheResult.class);
 beforeBeanDiscoveryEvent.addInterceptorBinding(CacheRemove.class);
 beforeBeanDiscoveryEvent.addInterceptorBinding(CacheRemoveAll.class);
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void observe(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
{
 setObserved(true);
 beforeBeanDiscovery.addQualifier(Tame.class);
 beforeBeanDiscovery.addScope(EpochScoped.class, false, false);
}
origin: org.jboss.seam.config/seam-config-xml

public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager)
    event.addQualifier(b);
    event.addInterceptorBinding(b);
    event.addStereotype(b.getKey(), b.getValue());
    log.info("Adding XML Defined Bean: " + tp.getJavaClass().getName());
    ProcessAnnotatedType<?> pat = new ProcessAnnotatedTypeImpl((AnnotatedType) tp);
    beanManager.fireEvent(pat, DefaultLiteral.INSTANCE);
    event.addAnnotatedType(pat.getAnnotatedType());
origin: org.apache.geronimo/geronimo-metrics

void letOtherExtensionsUseRegistries(@Observes final BeforeBeanDiscovery beforeBeanDiscovery, final BeanManager beanManager) {
  beforeBeanDiscovery.addQualifier(RegistryType.class);
  beanManager.fireEvent(applicationRegistry);
  beanManager.fireEvent(applicationRegistry, new RegistryTypeImpl(MetricRegistry.Type.APPLICATION));
  beanManager.fireEvent(baseRegistry, new RegistryTypeImpl(MetricRegistry.Type.BASE));
  beanManager.fireEvent(vendorRegistry, new RegistryTypeImpl(MetricRegistry.Type.VENDOR));
  // we make @Metric.name binding (to avoid to write producers relying on injection point)
  beforeBeanDiscovery.configureQualifier(org.eclipse.microprofile.metrics.annotation.Metric.class)
      .methods().stream().filter(method -> method.getAnnotated().getJavaMember().getName().equals("name"))
      .forEach(method -> method.remove(a -> a.annotationType() == Nonbinding.class));
}
origin: io.astefanutti.metrics.cdi/metrics-cdi

static <T extends Annotation> void declareAsInterceptorBinding(Class<T> annotation, BeanManager manager, BeforeBeanDiscovery bbd) {
  AnnotatedType<T> annotated = manager.createAnnotatedType(annotation);
  Set<AnnotatedMethod<? super T>> methods = new HashSet<>();
  for (AnnotatedMethod<? super T> method : annotated.getMethods())
    methods.add(new AnnotatedMethodDecorator<>(method, NON_BINDING));
  bbd.addInterceptorBinding(new AnnotatedTypeDecorator<>(annotated, INTERCEPTOR_BINDING, methods));
}
origin: org.jboss.cdi.tck/cdi-tck-impl

  void execute() {
    event.addScope(SimpleAnnotation.class, true, false);
  }
}.run();
origin: org.jboss.cdi.tck/cdi-tck-impl

  void execute() {
    event.addInterceptorBinding(annotation);
  }
}.run();
origin: org.jboss.cdi.tck/cdi-tck-impl

  void execute() {
    event.addQualifier(SimpleAnnotation.class);
  }
}.run();
origin: weld/core

void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) {
  event.addAnnotatedType(VetoedSuppressedAnnotatedType.from(ActivateRequestContextInterceptor.class, beanManager),
      ActivateRequestContextInterceptor.class.getName());
  event.addAnnotatedType(VetoedSuppressedAnnotatedType.from(CdiRequestContextActivatorInterceptor.class, beanManager),
      CdiRequestContextActivatorInterceptor.class.getName());
}
origin: org.apache.myfaces.core/myfaces-impl

void beforeBeanDiscovery(
  @Observes final BeforeBeanDiscovery event, BeanManager beanManager)
{
  event.addScope(FlowScoped.class, true, true);
  // Register FlowBuilderFactoryBean as a bean with CDI annotations, so the system
  // can take it into account, and use it later when necessary.
  AnnotatedType bean = beanManager.createAnnotatedType(FlowScopeBeanHolder.class);
  event.addAnnotatedType(bean, bean.getJavaClass().getName());
}

javax.enterprise.inject.spiBeforeBeanDiscovery

Javadoc

This event type is thrown by the container before the bean discovery process begins. If any observer method of the BeforeBeanDiscovery event throws an exception, the exception is treated as a definition error by the container.

Most used methods

  • addAnnotatedType
    Adds new annotated type for classes which are not picked up by the CDI container or if you like to a
  • addScope
    Declares a new scope.
  • addInterceptorBinding
    Declare a new interceptor binding via the information from the given AnnotatedType.
  • addQualifier
    Declare a new qualifier via the information from the given AnnotatedType.
  • addStereotype
    Declares a new stereotype.
  • configureInterceptorBinding
    Obtains a new AnnotatedTypeConfigurator to configure a new javax.enterprise.inject.spi.AnnotatedTyp
  • configureQualifier
    Obtains a new AnnotatedTypeConfigurator to configure a new javax.enterprise.inject.spi.AnnotatedTyp

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Kernel (java.awt.image)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now