/**
   * Used to register the method validation interceptor binding annotation.
   *
   * @param beforeBeanDiscoveryEvent event fired before the bean discovery process starts
   * @param beanManager the bean manager.
   */
  public void beforeBeanDiscovery(
      @Observes BeforeBeanDiscovery beforeBeanDiscoveryEvent, final BeanManager beanManager) {
    Contracts.assertNotNull(
        beforeBeanDiscoveryEvent, "The BeforeBeanDiscovery event cannot be null");
    Contracts.assertNotNull(beanManager, "The BeanManager cannot be null");

    // Register the interceptor explicitly. This way, no beans.xml is needed
    AnnotatedType<ValidationInterceptor> annotatedType =
        beanManager.createAnnotatedType(ValidationInterceptor.class);
    beforeBeanDiscoveryEvent.addAnnotatedType(annotatedType);
  }
Exemplo n.º 2
0
  /**
   * Register all admin CDI beans.
   *
   * @param bbd the bbd event
   * @param bm the bean manager
   */
  public void register(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {

    // Current API
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationManagerImpl.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorMandatory.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorNever.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorNotSupported.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorRequired.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorRequiresNew.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensationInterceptorSupports.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(TxCompensateInterceptor.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(TxConfirmInterceptor.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(TxLoggedInterceptor.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CancelOnFailureInterceptor.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(CompensatableActionProducer.class));
    bbd.addAnnotatedType(bm.createAnnotatedType(DeserializersContainerProducer.class));
  }
 public void addStageConfig(@Observes BeforeBeanDiscovery bbd, BeanManager beanManager) {
   bbd.addAnnotatedType(beanManager.createAnnotatedType(ConfigurationValueProducer.class));
 }
Exemplo n.º 4
0
 void registerApple(@Observes BeforeBeanDiscovery event, BeanManager manager) {
   event.addAnnotatedType(
       new AnnotatedTypeWrapper<Pear>(
           manager.createAnnotatedType(Pear.class), false, Juicy.Literal.INSTANCE));
 }