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 javax.enterprise.inject.spi;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.List;
import java.util.Set;
import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Event;
import javax.enterprise.event.NotificationOptions;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.InjectionException;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.UnsatisfiedResolutionException;
/**
*
The interface BeanManager is the central point for dealing with CDI.
* The BeanManager provides operations for resolving CDI {@link Bean}s,
* obtaining the Contextual References of them, etc. There are operations
* related with;
*
*
*
Firing observer events
*
Creating {@link CreationalContext}s
*
Resolution of beans, interceptors, decorators and observers
*
Other utility methods etc..
*
*
*/
public interface BeanManager
{
/**
* Returns a bean instance reference for the given bean.
*
* @param bean bean that its reference is getting
* @param beanType bean api type that is implemented by the proxy
* @param ctx creational context is used to destroy any object with scope @Dependent
* @return bean reference
* @throws IllegalArgumentException if given bean type is not api type of the given bean object
* @throws java.lang.IllegalStateException if this method gets called before the AfterDeploymentValidation event is fired.
*/
Object getReference(Bean> bean, Type beanType, CreationalContext> ctx);
/**
* Gets injection point bean reference.
*
* @param injectionPoint injection point definition
* @param ctx creational context that is passed to the {@link Bean#create(CreationalContext)} method
* @return bean reference
* @throws UnsatisfiedResolutionException if no bean found for the given injection point
* @throws AmbiguousResolutionException if more than one bean found
* @throws java.lang.IllegalStateException if this method gets called before the AfterDeploymentValidation event is fired.
*/
Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext> ctx);
/**
* Returns a new creational context implementation.
*
* @return new creational context
*/
CreationalContext createCreationalContext(Contextual contextual);
/**
* Returns set of beans that their api types contain
* given bean type and given qualifiers.
*
*
* If no qualifier is given, @Current is assumed.
*
*
* @param beanType required bean type
* @param qualifiers required qualifiers
* @return set of beans
* @throws IllegalArgumentException given bean type is a {@link TypeVariable}
* @throws IllegalArgumentException given qualifier annotation is not a qualifier
* @throws IllegalArgumentException same qualifier is given
* @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired.
*/
Set> getBeans(Type beanType, Annotation... qualifiers);
/**
* Returns set of beans with given Expression Language name.
*
* @param name name of the bean
* @return set of beans with given name
* @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired.
*/
Set> getBeans(String name);
/**
* Returns passivation capable bean given id.
*
* @param id bean id
* @return passivation capable bean given id
* @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired.
*/
Bean> getPassivationCapableBean(String id);
/**
* Returns a bean object that is resolved according to the type safe resolution rules.
*
* @param bean class info
* @param beans set of beans
* @return bean that is resolved according to the type safe resolution rules
* @throws AmbiguousResolutionException if ambigious exists
* @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired.
*/
Bean extends X> resolve(Set> beans);
/**
* Can be used to wrap a CDI proxy around a contextual instance
* inside of producer methods or Custom Beans.
*
* @param creationalContext used to store Interceptor and Decorator instances which are by definition Dependent
* @param clazz the BeanClass
* @param the type of the BeanClass
* @return an InterceptionFactory which will use the given CreationalContext to store created instances.
*/
InterceptionFactory createInterceptionFactory(CreationalContext creationalContext, Class clazz);
/**
* Fires a synchronous event with given even object and qualifiers.
*
* For firing asynchronous events you first have to get an {@link Event} via
* {@link #getEvent()} and then use the {@link Event#fireAsync(Object)}
* or {@link Event#fireAsync(Object, NotificationOptions)} methods.
*
* @param event observer event object
* @param qualifiers event qualifiers
* @throws IllegalArgumentException event object contains a {@link TypeVariable}
* @throws IllegalArgumentException given qualifier annotation is not a qualifier
* @throws IllegalArgumentException same qualifier is given
*
* @see #getEvent()
*/
void fireEvent(Object event, Annotation... qualifiers);
/**
* @return an Event instance with Object/Default
*/
Event