Package javax.enterprise.event

Examples of javax.enterprise.event.Observes


    _args = new BeanArg[parameters.size()];

    for (int i = 0; i < _args.length; i++) {
      AnnotatedParameter<?> param = parameters.get(i);

      Observes observes = param.getAnnotation(Observes.class);

      if (observes != null) {
        _isIfExists = observes.notifyObserver() == Reception.IF_EXISTS;
      }
      else {
        _args[i] = new BeanArg(param.getBaseType(),
                               _beanManager.getQualifiers(param.getAnnotations()));
      }
View Full Code Here


    _method.setAccessible(true);
    _paramIndex = paramIndex;

    for (Annotation ann : method.getParameterAnnotations()[paramIndex]) {
      if (ann instanceof Observes) {
        Observes observes = (Observes) ann;
        _ifExists = observes.notifyObserver() == Reception.IF_EXISTS;
      }
    }

    bind();
  }
View Full Code Here

    _method.setAccessible(true);
    _paramIndex = paramIndex;

    for (Annotation ann : method.getParameterAnnotations()[paramIndex]) {
      if (ann instanceof Observes) {
        Observes observes = (Observes) ann;
        _ifExists = observes.notifyObserver() == Reception.IF_EXISTS;
      }
    }

    bind();
  }
View Full Code Here

    for (Annotation ann : paramList.get(param).getAnnotations()) {
      if (ann.annotationType().isAnnotationPresent(Qualifier.class))
        bindingSet.add(ann);
    }
   
    Observes observes = paramList.get(param).getAnnotation(Observes.class);

    if (method.isAnnotationPresent(Inject.class)) {
      throw InjectManager.error(method, L.l("A method may not have both an @Observer and an @Inject annotation."));
    }

    if (method.isAnnotationPresent(Produces.class)) {
      throw InjectManager.error(method, L.l("A method may not have both an @Observer and a @Produces annotation."));
    }

    if (method.isAnnotationPresent(Disposes.class)) {
      throw InjectManager.error(method, L.l("A method may not have both an @Observer and a @Disposes annotation."));
    }

    ObserverMethodImpl<X,Z> observerMethod;
    switch(observes.during()) {
    case BEFORE_COMPLETION:
      observerMethod
        = new ObserverMethodBeforeCompletionImpl(_cdiManager,
                                                 bean,
                                                 beanMethod,
View Full Code Here

    _args = new BeanArg[parameters.size()];

    for (int i = 0; i < _args.length; i++) {
      AnnotatedParameter<?> param = parameters.get(i);

      Observes observes = param.getAnnotation(Observes.class);
     
      if (observes != null) {
        _isIfExists = observes.notifyObserver() == Reception.IF_EXISTS;
        _transactionPhase = observes.during();
      }
      else {
        InjectionPoint ip = new InjectionPointImpl(_cdiManager,
                                                   _bean,
                                                   param);
View Full Code Here

TOP

Related Classes of javax.enterprise.event.Observes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.