Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.webbeans.event;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Priority;
import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.event.ObservesAsync;
import javax.enterprise.event.Reception;
import javax.enterprise.event.TransactionPhase;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.EventContext;
import javax.enterprise.inject.spi.EventMetadata;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.ObserverMethod;
import javax.enterprise.inject.spi.WithAnnotations;
import org.apache.webbeans.component.AbstractOwbBean;
import org.apache.webbeans.component.WebBeansType;
import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.config.WebBeansContext;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.logger.WebBeansLoggerFacade;
import org.apache.webbeans.proxy.OwbNormalScopeProxy;
import org.apache.webbeans.spi.plugins.OpenWebBeansEjbPlugin;
/**
* Defines observers that are declared in observer methods.
*
* Example:
*
* public class X {
*
* public void afterLoggedIn(@Observes @Current LoggedInEvent event)
* {
* .....
* }
* }
*
* Above class X instance observes for the event with type LoggedInEvent
* and event qualifier is Current. Whenever event is fired, its {@link javax.enterprise.inject.spi.ObserverMethod#notify()}
* method is called.
*
*
* @version $Rev$ $Date$
*
* @param event type
*/
public class ObserverMethodImpl implements OwbObserverMethod
{
/**Logger instance*/
private static final Logger logger = WebBeansLoggerFacade.getLogger(ObserverMethodImpl.class);
/**Observer owner bean that defines observer method*/
private final AbstractOwbBean> ownerBean;
/**Using existing bean instance or not*/
private final boolean ifExist;
/** the observed qualifiers */
private final Set observedQualifiers;
/** the type of the observed event */
private final Type observedEventType;
/** the transaction phase */
private final TransactionPhase phase;
/** the injection points */
private final Set injectionPoints;
private final Method view;
/**Annotated method*/
private AnnotatedMethod annotatedObserverMethod;
/**\@Observes parameter*/
private AnnotatedParameter annotatedObservesParameter;
private int priority = ObserverMethod.DEFAULT_PRIORITY;
private boolean isAsync;
private static class ObserverParams
{
private Bean