コード例 #1
0
  public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) {
    final AnnotatedType annotationType = manager.createAnnotatedType(CDITransactionContext.class);
    final InjectionTarget injectionTarget = manager.createInjectionTarget(annotationType);
    final CreationalContext creationalContext = manager.createCreationalContext(null);
    final CDITransactionContext context = new CDITransactionContext();
    injectionTarget.inject(context, creationalContext);
    injectionTarget.postConstruct(CDITransactionContext.class);

    if (logger.isDebugEnabled()) {
      logger.debug("afterBeanDiscovery -> context " + context);
    }

    context.setBeanManager(manager);
    event.addContext(context);
  }
コード例 #2
0
 @PostConstruct
 public void init() {
   vorname = new SimpleStringProperty(this, map("vorname"));
   nachname = new SimpleStringProperty(this, map("nachname"));
   //        datum = new SimpleStringProperty(this, map("datum"));
   betrag = new SimpleDoubleProperty(this, map("betrag"));
   try {
     datumProperty = JavaBeanObjectPropertyBuilder.create().bean(this).name(map("datum")).build();
   } catch (NoSuchMethodException e) {
     logger.error(e);
   }
 }