Examples of Observes


Examples of javax.enterprise.event.Observes

                if(bean.getScope().equals(Dependent.class))
                {
                    //Check Reception
                     AnnotationUtil.getAnnotatedMethodFirstParameterWithAnnotation(annotatedMethod, Observes.class);
                   
                     Observes observes = AnnotationUtil.getAnnotatedMethodFirstParameterAnnotation(annotatedMethod, Observes.class);
                     Reception reception = observes.notifyObserver();
                     if(reception.equals(Reception.IF_EXISTS))
                     {
                         throw new WebBeansConfigurationException("Dependent Bean : " + bean + " can not define observer method with @Receiver = IF_EXIST");
                     }
                }
View Full Code Here

Examples of javax.enterprise.event.Observes

        }               

        if (bean.getScope().equals(Dependent.class))
        {
            //Check Reception
            Observes observes = annotatedParameter.getAnnotation(Observes.class);
            Reception reception = observes.notifyObserver();
            if(reception.equals(Reception.IF_EXISTS))
            {
                throw new WebBeansConfigurationException("Dependent Bean : " + annotatedType.getJavaClass() + " can not define observer method with @Receiver = IF_EXIST");
            }
        }
View Full Code Here

Examples of javax.enterprise.event.Observes

    {
        this.bean = bean;
        this.annotatedObservesParameter = annotatedObservesParameter;
        this.annotatedObserverMethod = annotatedObserverMethod;
        observedEventType = annotatedObservesParameter.getBaseType();
        Observes observes = annotatedObservesParameter.getAnnotation(Observes.class);
        ifExist = observes.notifyObserver() == Reception.IF_EXISTS;
        phase = observes.during();
        observedQualifiers = new HashSet<Annotation>();
        for (Annotation annotation: annotatedObservesParameter.getAnnotations())
        {
            if (bean.getWebBeansContext().getAnnotationManager().isQualifierAnnotation(annotation.annotationType()))
            {
View Full Code Here

Examples of javax.enterprise.event.Observes

    {
        this.bean = bean;
        this.annotatedObservesParameter = annotatedObservesParameter;
        this.annotatedObserverMethod = annotatedObserverMethod;
        observedEventType = annotatedObservesParameter.getBaseType();
        Observes observes = annotatedObservesParameter.getAnnotation(Observes.class);
        ifExist = observes.notifyObserver() == Reception.IF_EXISTS;
        phase = observes.during();
        observedQualifiers = new HashSet<Annotation>();
        for (Annotation annotation: annotatedObservesParameter.getAnnotations())
        {
            if (bean.getWebBeansContext().getAnnotationManager().isQualifierAnnotation(annotation.annotationType()))
            {
View Full Code Here

Examples of javax.enterprise.event.Observes

        }               

        if (bean.getScope().equals(Dependent.class))
        {
            //Check Reception
            Observes observes = annotatedParameter.getAnnotation(Observes.class);
            Reception reception = observes.notifyObserver();
            if(reception.equals(Reception.IF_EXISTS))
            {
                throw new WebBeansConfigurationException("Dependent Bean : " + annotatedType.getJavaClass() + " can not define observer method with @Receiver = IF_EXIST");
            }
        }
View Full Code Here

Examples of javax.enterprise.event.Observes

        Iterator<Method> itMethods = observableMethods.iterator();

        while (itMethods.hasNext())
        {
            Method observableMethod = itMethods.next();
            Observes observes = AnnotationUtil.getMethodFirstParameterAnnotation(observableMethod, Observes.class);
           
            Annotation[] bindingTypes = AnnotationUtil.getMethodFirstParameterQualifierWithGivenAnnotation(observableMethod, Observes.class);
           
            boolean ifExist = false;

            if (observes.notifyObserver().equals(Reception.IF_EXISTS))
            {
                ifExist = true;
            }

            TransactionalObserverType type = EventUtil.getObserverMethodTransactionType(observableMethod);
View Full Code Here

Examples of javax.enterprise.event.Observes

        AnnotationUtil.checkQualifierConditions(annotations);
    }

    public static TransactionalObserverType getObserverMethodTransactionType(Method observerMethod)
    {
        Observes observes = AnnotationUtil.getMethodFirstParameterAnnotation(observerMethod, Observes.class);
       
        if (observes.during().equals(TransactionPhase.AFTER_COMPLETION))
        {
            return TransactionalObserverType.AFTER_TRANSACTION_COMPLETION;
        }
        else if (observes.during().equals(TransactionPhase.AFTER_SUCCESS))
        {
            return TransactionalObserverType.AFTER_TRANSACTION_SUCCESS;
        }
        else if (observes.during().equals(TransactionPhase.AFTER_FAILURE))
        {
            return TransactionalObserverType.AFTER_TRANSACTION_FAILURE;
        }
        else if (observes.during().equals(TransactionPhase.BEFORE_COMPLETION))
        {
            return TransactionalObserverType.BEFORE_TRANSACTION_COMPLETION;
        }
        else
        {
View Full Code Here

Examples of javax.enterprise.event.Observes

                if (bean.getScope().equals(Dependent.class))
                {
                    //Check Reception
                     AnnotationUtil.getAnnotatedMethodFirstParameterWithAnnotation(annotatedMethod, Observes.class);
                   
                     Observes observes = AnnotationUtil.getAnnotatedMethodFirstParameterAnnotation(annotatedMethod, Observes.class);
                     Reception reception = observes.notifyObserver();
                     if(reception.equals(Reception.IF_EXISTS))
                     {
                         throw new WebBeansConfigurationException("Dependent Bean : " + annotatedType.getJavaClass() + " can not define observer method with @Receiver = IF_EXIST");
                     }
                }
View Full Code Here

Examples of javax.enterprise.event.Observes

     */
    public <T> ObserverMethod<?> getObservableMethodForAnnotatedMethod(AnnotatedMethod<?> annotatedMethod, AbstractOwbBean<T> bean)
    {
        Asserts.assertNotNull(annotatedMethod, "annotatedMethod parameter can not be null");

        Observes observes = AnnotationUtil.getAnnotatedMethodFirstParameterAnnotation(annotatedMethod, Observes.class);
        boolean ifExist = false;
        if(observes != null)
        {
            if (observes.notifyObserver().equals(Reception.IF_EXISTS))
            {
                ifExist = true;
            }           
        }
       
View Full Code Here

Examples of javax.enterprise.event.Observes

        webBeansContext.getAnnotationManager().checkQualifierConditions(annotations);
    }

    public static TransactionPhase getObserverMethodTransactionType(AnnotatedMethod<?> observerMethod)
    {
        Observes observes = AnnotationUtil.getAnnotatedMethodFirstParameterAnnotation(observerMethod, Observes.class);
        if (observes != null)
        {
            return observes.during();
        }
       
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.