Codota Logo
BeforeBeanDiscovery.addInterceptorBinding
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using javax.enterprise.inject.spi.BeforeBeanDiscovery.addInterceptorBinding (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
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: org.jboss.cdi.tck/cdi-tck-impl

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

  void execute() {
    event.addInterceptorBinding(annotation);
  }
}.run();
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: tomitribe/microscoped

public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd) {
  bbd.addScope(MethodScoped.class, true, false);
  bbd.addInterceptorBinding(MethodScopeEnabled.class);
}
origin: tomitribe/microscoped

public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd) {
  bbd.addScope(TimerScoped.class, true, false);
  bbd.addInterceptorBinding(TimerScopeEnabled.class);
}
origin: org.apache.bval/bval-jsr

public void addBvalBinding(final @Observes BeforeBeanDiscovery beforeBeanDiscovery, final BeanManager beanManager) {
  beforeBeanDiscovery.addInterceptorBinding(BValBinding.class);
  beforeBeanDiscovery.addAnnotatedType(beanManager.createAnnotatedType(BValInterceptor.class));
}
origin: org.apache.tomee.patch/bval-jsr

public void addBvalBinding(final @Observes BeforeBeanDiscovery beforeBeanDiscovery, final BeanManager beanManager) {
  beforeBeanDiscovery.addInterceptorBinding(BValBinding.class);
  beforeBeanDiscovery.addAnnotatedType(beanManager.createAnnotatedType(BValInterceptor.class));
}
origin: io.thorntail/swagger

/**
 * Associate the InterceptorBinding annotation.
 */
public void processBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) {
  event.addInterceptorBinding(beanManager.createAnnotatedType(AddSwaggerResources.class));
  event.addAnnotatedType(beanManager.createAnnotatedType(SwaggerRestApplicationInterceptor.class), SwaggerRestApplicationInterceptor.class.getName());
}
origin: astefanutti/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: 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.apache.commons/commons-jcs-jcache

protected void discoverInterceptorBindings(final @Observes BeforeBeanDiscovery beforeBeanDiscoveryEvent,
                      final BeanManager bm)
{
  // CDI 1.1 will just pick createAnnotatedType(X) as beans so we'll skip our HelperBean
  // but CDI 1.0 needs our HelperBean + interceptors in beans.xml like:
  /*
  <beans xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
   <interceptors>
    <class>org.apache.commons.jcs.jcache.cdi.CacheResultInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CacheRemoveAllInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CacheRemoveInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CachePutInterceptor</class>
   </interceptors>
  </beans>
   */
  bm.createAnnotatedType(CDIJCacheHelper.class);
  for (final Class<?> interceptor : asList(
      CachePutInterceptor.class, CacheRemoveInterceptor.class,
      CacheRemoveAllInterceptor.class, CacheResultInterceptor.class)) {
    beforeBeanDiscoveryEvent.addAnnotatedType(bm.createAnnotatedType(interceptor));
  }
  for (final Class<? extends Annotation> interceptor : asList(
      CachePut.class, CacheRemove.class,
      CacheRemoveAll.class, CacheResult.class)) {
    beforeBeanDiscoveryEvent.addInterceptorBinding(interceptor);
  }
}
origin: org.apache.tomee.patch/commons-jcs-jcache

protected void discoverInterceptorBindings(final @Observes BeforeBeanDiscovery beforeBeanDiscoveryEvent,
                      final BeanManager bm)
{
  // CDI 1.1 will just pick createAnnotatedType(X) as beans so we'll skip our HelperBean
  // but CDI 1.0 needs our HelperBean + interceptors in beans.xml like:
  /*
  <beans xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
   <interceptors>
    <class>org.apache.commons.jcs.jcache.cdi.CacheResultInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CacheRemoveAllInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CacheRemoveInterceptor</class>
    <class>org.apache.commons.jcs.jcache.cdi.CachePutInterceptor</class>
   </interceptors>
  </beans>
   */
  bm.createAnnotatedType(CDIJCacheHelper.class);
  for (final Class<?> interceptor : asList(
      CachePutInterceptor.class, CacheRemoveInterceptor.class,
      CacheRemoveAllInterceptor.class, CacheResultInterceptor.class)) {
    beforeBeanDiscoveryEvent.addAnnotatedType(bm.createAnnotatedType(interceptor));
  }
  for (final Class<? extends Annotation> interceptor : asList(
      CachePut.class, CacheRemove.class,
      CacheRemoveAll.class, CacheResult.class)) {
    beforeBeanDiscoveryEvent.addInterceptorBinding(interceptor);
  }
}
origin: org.apache.geronimo/geronimo-jcache-simple

protected void discoverInterceptorBindings(final @Observes BeforeBeanDiscovery beforeBeanDiscoveryEvent,
    final BeanManager bm) {
  if (SKIP) {
    return;
  }
  // CDI 1.1 will just pick createAnnotatedType(X) as beans so we'll skip our HelperBean
  // but CDI 1.0 needs our HelperBean + interceptors in beans.xml like:
  /*
   * <beans xmlns="http://java.sun.com/xml/ns/javaee"
   * xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   * xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
   * http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
   * <interceptors>
   * <class>org.apache.geronimo.jcache.simple.cdi.CacheResultInterceptor</class>
   * <class>org.apache.geronimo.jcache.simple.cdi.CacheRemoveAllInterceptor</class>
   * <class>org.apache.geronimo.jcache.simple.cdi.CacheRemoveInterceptor</class>
   * <class>org.apache.geronimo.jcache.simple.cdi.CachePutInterceptor</class>
   * </interceptors>
   * </beans>
   */
  bm.createAnnotatedType(CDIJCacheHelper.class);
  for (final Class<?> interceptor : asList(CachePutInterceptor.class, CacheRemoveInterceptor.class,
      CacheRemoveAllInterceptor.class, CacheResultInterceptor.class)) {
    beforeBeanDiscoveryEvent.addAnnotatedType(bm.createAnnotatedType(interceptor));
  }
  for (final Class<? extends Annotation> interceptor : asList(CachePut.class, CacheRemove.class, CacheRemoveAll.class,
      CacheResult.class)) {
    beforeBeanDiscoveryEvent.addInterceptorBinding(interceptor);
  }
}
origin: io.smallrye/smallrye-fault-tolerance

void registerInterceptorBindings(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
  LOGGER.info("MicroProfile: Fault Tolerance activated");
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(CircuitBreaker.class)));
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Retry.class)));
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Timeout.class)));
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Asynchronous.class)));
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Fallback.class)));
  bbd.addInterceptorBinding(new HystrixInterceptorBindingAnnotatedType<>(bm.createAnnotatedType(Bulkhead.class)));
  // Add AnnotatedType for HystrixCommandInterceptor
  // It seems that fraction deployment module cannot be picked up as a CDI bean archive - see also SWARM-1725
  bbd.addAnnotatedType(bm.createAnnotatedType(HystrixCommandInterceptor.class), HystrixCommandInterceptor.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(HystrixInitializer.class), HystrixInitializer.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(DefaultHystrixConcurrencyStrategy.class), DefaultHystrixConcurrencyStrategy.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(DefaultFaultToleranceOperationProvider.class), DefaultFaultToleranceOperationProvider.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(DefaultFallbackHandlerProvider.class), DefaultFallbackHandlerProvider.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(DefaultCommandListenersProvider.class), DefaultCommandListenersProvider.class.getName());
  bbd.addAnnotatedType(bm.createAnnotatedType(MetricsCollectorFactory.class), MetricsCollectorFactory.class.getName());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

  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.jboss.seam.config/seam-config-xml

event.addInterceptorBinding(b);
javax.enterprise.inject.spiBeforeBeanDiscoveryaddInterceptorBinding

Javadoc

Declares an annotation type as an Interceptor binding type, and specifies its meta-annotations.

This is only required if you wish to make an annotation an interceptor binding type without adding InterceptorBinding to it.

Popular methods of BeforeBeanDiscovery

  • 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.
  • 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

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now