Package org.jboss.weld.bean.builtin
Class BeanManagerProxy
- java.lang.Object
-
- org.jboss.weld.util.ForwardingBeanManager
-
- org.jboss.weld.bean.builtin.BeanManagerProxy
-
- All Implemented Interfaces:
Serializable,BeanManager,org.jboss.weld.manager.api.WeldManager
public class BeanManagerProxy extends ForwardingBeanManager implements org.jboss.weld.manager.api.WeldManager
Client view ofBeanManagerImpl.- Author:
- Martin Kouba
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BeanManagerProxy(BeanManagerImpl manager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> AnnotatedType<T>createAnnotatedType(Class<T> type, String id)<T> org.jboss.weld.construction.api.WeldCreationalContext<T>createCreationalContext(Contextual<T> contextual)Obtain an instance of aCreationalContextfor the given contextual type, or for a non-contextual object.<T> InjectionTarget<T>createInjectionTarget(org.jboss.weld.ejb.spi.EjbDescriptor<T> descriptor)<T> org.jboss.weld.manager.api.WeldInjectionTargetBuilder<T>createInjectionTargetBuilder(AnnotatedType<T> type)WeldInstance<Object>createInstance()Obtains anInstanceobject to access to beans instances.BeanManagerImpldelegate()<T> voiddisposeAnnotatedType(Class<T> type, String id)<X> InjectionTarget<X>fireProcessInjectionTarget(AnnotatedType<X> type)<X> InjectionTarget<X>fireProcessInjectionTarget(AnnotatedType<X> annotatedType, InjectionTarget<X> injectionTarget)<T> Bean<T>getBean(org.jboss.weld.ejb.spi.EjbDescriptor<T> descriptor)Set<Bean<?>>getBeans(Type beanType, Annotation... qualifiers)Return the set of beans which have the given required type and qualifiers and are available for injection in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of typesafe resolution.Set<Bean<?>>getBeans(String name)Return the set of beans which have the given EL name and are available for injection in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of EL name resolution.<T> org.jboss.weld.ejb.spi.EjbDescriptor<T>getEjbDescriptor(String ejbName)StringgetId()ObjectgetInjectableReference(InjectionPoint ij, CreationalContext<?> ctx)Obtains an injectable reference for a certain injection point.<T> org.jboss.weld.manager.api.WeldInjectionTargetFactory<T>getInjectionTargetFactory(AnnotatedType<T> annotatedType)An implementation ofInjectionTargetFactorythat provides container createdInjectionTargetinstances.Bean<?>getPassivationCapableBean(String id)Returns thePassivationCapablebean with the given identifier.Bean<?>getPassivationCapableBean(org.jboss.weld.serialization.spi.BeanIdentifier identifier)ObjectgetReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx)Obtains a contextual reference for a certain bean and a certain bean type of the bean.Collection<Class<? extends Annotation>>getScopes()org.jboss.weld.bootstrap.api.ServiceRegistrygetServices()Instance<Object>instance()booleanisContextActive(Class<? extends Annotation> scopeType)protected ObjectreadResolve()<X> Bean<? extends X>resolve(Set<Bean<? extends X>> beans)Apply the ambiguous dependency resolution rules to a set of beans.List<Decorator<?>>resolveDecorators(Set<Type> types, Annotation... qualifiers)Return an ordered list of decorators for a set of bean types and a set of qualifiers and which are enabled in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained.List<Interceptor<?>>resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)Return an ordered list of enabled interceptors for a set of interceptor bindings and a type of interception and which are enabled in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained.<T> Set<ObserverMethod<? super T>>resolveObserverMethods(T event, Annotation... qualifiers)Return an ordered set of observer methods for an event.static BeanManagerImpltryUnwrap(Object instance)BeanManagerImplunwrap()static BeanManagerImplunwrap(BeanManager manager)voidvalidate(InjectionPoint injectionPoint)Validate a certain injection point.-
Methods inherited from class org.jboss.weld.util.ForwardingBeanManager
areInterceptorBindingsEquivalent, areQualifiersEquivalent, createAnnotatedType, createBean, createBean, createBeanAttributes, createBeanAttributes, createInjectionPoint, createInjectionPoint, createInjectionTarget, createInterceptionFactory, equals, fireEvent, getContext, getELResolver, getEvent, getExtension, getInterceptorBindingDefinition, getInterceptorBindingHashCode, getProducerFactory, getProducerFactory, getQualifierHashCode, getStereotypeDefinition, hashCode, isInterceptorBinding, isNormalScope, isPassivatingScope, isQualifier, isScope, isStereotype, toString, wrapExpressionFactory
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.BeanManager
areInterceptorBindingsEquivalent, areQualifiersEquivalent, createAnnotatedType, createBean, createBean, createBeanAttributes, createBeanAttributes, createInjectionPoint, createInjectionPoint, createInjectionTarget, createInterceptionFactory, fireEvent, getContext, getELResolver, getEvent, getExtension, getInterceptorBindingDefinition, getInterceptorBindingHashCode, getProducerFactory, getProducerFactory, getQualifierHashCode, getStereotypeDefinition, isInterceptorBinding, isNormalScope, isPassivatingScope, isQualifier, isScope, isStereotype, wrapExpressionFactory
-
-
-
-
Constructor Detail
-
BeanManagerProxy
public BeanManagerProxy(BeanManagerImpl manager)
-
-
Method Detail
-
delegate
public BeanManagerImpl delegate()
- Specified by:
delegatein classForwardingBeanManager
-
getReference
public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx)
Description copied from interface:BeanManagerObtains a contextual reference for a certain bean and a certain bean type of the bean.
- Specified by:
getReferencein interfaceBeanManager- Overrides:
getReferencein classForwardingBeanManager- Parameters:
bean- theBeanobject representing the beanbeanType- a bean type that must be implemented by any client proxy that is returnedctx- aCreationalContextthat may be used to destroy any object with scopeDependentthat is created- Returns:
- a contextual reference representing the bean
-
getInjectableReference
public Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx)
Description copied from interface:BeanManagerObtains an injectable reference for a certain injection point.
- Specified by:
getInjectableReferencein interfaceBeanManager- Overrides:
getInjectableReferencein classForwardingBeanManager- Parameters:
ij- the target injection pointctx- aCreationalContextthat may be used to destroy any object with scopeDependentthat is created- Returns:
- the injectable reference
-
getBeans
public Set<Bean<?>> getBeans(Type beanType, Annotation... qualifiers)
Description copied from interface:BeanManagerReturn the set of beans which have the given required type and qualifiers and are available for injection in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of typesafe resolution. If no qualifiers are given, the default qualifier is assumed.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return beans discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
getBeansin interfaceBeanManager- Overrides:
getBeansin classForwardingBeanManager- Parameters:
beanType- the required bean typequalifiers- the required qualifiers- Returns:
- the resulting set of beans
-
getBeans
public Set<Bean<?>> getBeans(String name)
Description copied from interface:BeanManagerReturn the set of beans which have the given EL name and are available for injection in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of EL name resolution.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return beans discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
getBeansin interfaceBeanManager- Overrides:
getBeansin classForwardingBeanManager- Parameters:
name- the EL name- Returns:
- the resulting set of beans
-
getPassivationCapableBean
public Bean<?> getPassivationCapableBean(String id)
Description copied from interface:BeanManagerReturns thePassivationCapablebean with the given identifier.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return beans discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
getPassivationCapableBeanin interfaceBeanManager- Overrides:
getPassivationCapableBeanin classForwardingBeanManager- Parameters:
id- the identifier- Returns:
- a
Beanthat implementsPassivationCapableand has the given identifier, or a null value if there is no such bean
-
resolve
public <X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans)
Description copied from interface:BeanManagerApply the ambiguous dependency resolution rules to a set of beans.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return beans discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
resolvein interfaceBeanManager- Overrides:
resolvein classForwardingBeanManager- Type Parameters:
X- a common type of the beans- Parameters:
beans- a set of beans of the given type- Returns:
- the resolved bean, or null if null or an empty set is passed
-
validate
public void validate(InjectionPoint injectionPoint)
Description copied from interface:BeanManagerValidate a certain injection point.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only validate injection points discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
validatein interfaceBeanManager- Overrides:
validatein classForwardingBeanManager- Parameters:
injectionPoint- the injection point to validate
-
resolveObserverMethods
public <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, Annotation... qualifiers)
Description copied from interface:BeanManagerReturn an ordered set of observer methods for an event.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return observers discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
resolveObserverMethodsin interfaceBeanManager- Overrides:
resolveObserverMethodsin classForwardingBeanManager- Type Parameters:
T- the type of the event- Parameters:
event- the event objectqualifiers- the event qualifiers- Returns:
- the resulting set of observer methods
-
resolveDecorators
public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers)
Description copied from interface:BeanManagerReturn an ordered list of decorators for a set of bean types and a set of qualifiers and which are enabled in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return decorators discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
resolveDecoratorsin interfaceBeanManager- Overrides:
resolveDecoratorsin classForwardingBeanManager- Parameters:
types- the set of bean types of the decorated beanqualifiers- the qualifiers declared by the decorated bean- Returns:
- the resulting set of decorators
-
resolveInterceptors
public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
Description copied from interface:BeanManagerReturn an ordered list of enabled interceptors for a set of interceptor bindings and a type of interception and which are enabled in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained.
Note that when called during invocation of anAfterBeanDiscoveryevent observer, this method will only return interceptors discovered by the container before theAfterBeanDiscoveryevent is fired.- Specified by:
resolveInterceptorsin interfaceBeanManager- Overrides:
resolveInterceptorsin classForwardingBeanManager- Parameters:
type- the type of the interceptioninterceptorBindings- the interceptor bindings- Returns:
- the resulting set of interceptors
-
createInjectionTarget
public <T> InjectionTarget<T> createInjectionTarget(org.jboss.weld.ejb.spi.EjbDescriptor<T> descriptor)
- Specified by:
createInjectionTargetin interfaceorg.jboss.weld.manager.api.WeldManager
-
getBean
public <T> Bean<T> getBean(org.jboss.weld.ejb.spi.EjbDescriptor<T> descriptor)
- Specified by:
getBeanin interfaceorg.jboss.weld.manager.api.WeldManager
-
getEjbDescriptor
public <T> org.jboss.weld.ejb.spi.EjbDescriptor<T> getEjbDescriptor(String ejbName)
- Specified by:
getEjbDescriptorin interfaceorg.jboss.weld.manager.api.WeldManager
-
getServices
public org.jboss.weld.bootstrap.api.ServiceRegistry getServices()
- Specified by:
getServicesin interfaceorg.jboss.weld.manager.api.WeldManager
-
fireProcessInjectionTarget
public <X> InjectionTarget<X> fireProcessInjectionTarget(AnnotatedType<X> type)
- Specified by:
fireProcessInjectionTargetin interfaceorg.jboss.weld.manager.api.WeldManager
-
fireProcessInjectionTarget
public <X> InjectionTarget<X> fireProcessInjectionTarget(AnnotatedType<X> annotatedType, InjectionTarget<X> injectionTarget)
- Specified by:
fireProcessInjectionTargetin interfaceorg.jboss.weld.manager.api.WeldManager
-
getId
public String getId()
- Specified by:
getIdin interfaceorg.jboss.weld.manager.api.WeldManager
-
instance
public Instance<Object> instance()
- Specified by:
instancein interfaceorg.jboss.weld.manager.api.WeldManager
-
createInstance
public WeldInstance<Object> createInstance()
Description copied from interface:BeanManagerObtains anInstanceobject to access to beans instances. The returned Instance object can only access instances of beans that are available for injection in the module or library containing the class into which the BeanManager was injected or the Jakarta EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of typesafe resolution. Note that when called during invocation of anAfterBeanDiscoveryevent observer, the Instance returned by this method will only give access to instances of beans discovered by the container before theAfterBeanDiscoveryevent is fired. Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by callingInstance.destroy(Object)If no qualifier is passed toInstance.select(java.lang.annotation.Annotation...)method, the @Default qualifier is assumed.- Specified by:
createInstancein interfaceBeanManager- Overrides:
createInstancein classForwardingBeanManager- Returns:
- an
Instanceobject to request beans instances
-
getPassivationCapableBean
public Bean<?> getPassivationCapableBean(org.jboss.weld.serialization.spi.BeanIdentifier identifier)
- Specified by:
getPassivationCapableBeanin interfaceorg.jboss.weld.manager.api.WeldManager
-
createInjectionTargetBuilder
public <T> org.jboss.weld.manager.api.WeldInjectionTargetBuilder<T> createInjectionTargetBuilder(AnnotatedType<T> type)
- Specified by:
createInjectionTargetBuilderin interfaceorg.jboss.weld.manager.api.WeldManager
-
getInjectionTargetFactory
public <T> org.jboss.weld.manager.api.WeldInjectionTargetFactory<T> getInjectionTargetFactory(AnnotatedType<T> annotatedType)
Description copied from interface:BeanManagerAn implementation of
InjectionTargetFactorythat provides container createdInjectionTargetinstances.This factory can be wrapped to add behavior to container created injection targets.
- Specified by:
getInjectionTargetFactoryin interfaceBeanManager- Specified by:
getInjectionTargetFactoryin interfaceorg.jboss.weld.manager.api.WeldManager- Overrides:
getInjectionTargetFactoryin classForwardingBeanManager- Parameters:
annotatedType- the annotated type to create the injection target factory for- Returns:
- an
InjectionTargetFactory
-
createCreationalContext
public <T> org.jboss.weld.construction.api.WeldCreationalContext<T> createCreationalContext(Contextual<T> contextual)
Description copied from interface:BeanManagerObtain an instance of aCreationalContextfor the given contextual type, or for a non-contextual object.- Specified by:
createCreationalContextin interfaceBeanManager- Specified by:
createCreationalContextin interfaceorg.jboss.weld.manager.api.WeldManager- Overrides:
createCreationalContextin classForwardingBeanManager- Parameters:
contextual- theContextual, or a null value in the case of a non-contextual object- Returns:
- the new
CreationalContext
-
readResolve
protected Object readResolve() throws ObjectStreamException
- Throws:
ObjectStreamException
-
unwrap
public static BeanManagerImpl unwrap(BeanManager manager)
-
tryUnwrap
public static BeanManagerImpl tryUnwrap(Object instance)
-
unwrap
public BeanManagerImpl unwrap()
- Specified by:
unwrapin interfaceorg.jboss.weld.manager.api.WeldManager
-
createAnnotatedType
public <T> AnnotatedType<T> createAnnotatedType(Class<T> type, String id)
- Specified by:
createAnnotatedTypein interfaceorg.jboss.weld.manager.api.WeldManager
-
disposeAnnotatedType
public <T> void disposeAnnotatedType(Class<T> type, String id)
- Specified by:
disposeAnnotatedTypein interfaceorg.jboss.weld.manager.api.WeldManager
-
isContextActive
public boolean isContextActive(Class<? extends Annotation> scopeType)
- Specified by:
isContextActivein interfaceorg.jboss.weld.manager.api.WeldManager
-
getScopes
public Collection<Class<? extends Annotation>> getScopes()
- Specified by:
getScopesin interfaceorg.jboss.weld.manager.api.WeldManager
-
-