类 SimpleJndiBeanFactory
java.lang.Object
cn.taketoday.jndi.JndiAccessor
cn.taketoday.jndi.JndiLocatorSupport
cn.taketoday.jndi.support.SimpleJndiBeanFactory
- 所有已实现的接口:
BeanFactory,DependencyInjectorProvider
Simple JNDI-based implementation of Framework's
BeanFactory interface.
Does not support enumerating bean definitions
This factory resolves given bean names as JNDI names within the
Jakarta EE application's "java:comp/env/" namespace. It caches the resolved
types for all obtained objects, and optionally also caches shareable
objects (if they are explicitly marked as
shareable resource.
The main intent of this factory is usage in combination with Framework's
CommonAnnotationBeanPostProcessor,
configured as "resourceFactory" for resolving @Resource
annotations as JNDI objects without intermediate bean definitions.
It may be used for similar lookup scenarios as well, of course,
in particular if BeanFactory-style type checking is required.
- 从以下版本开始:
- 4.0 2022/3/5 12:11
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
从类继承的字段 cn.taketoday.jndi.JndiLocatorSupport
CONTAINER_PREFIX从类继承的字段 cn.taketoday.jndi.JndiAccessor
logger从接口继承的字段 cn.taketoday.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddShareableResource(String shareableResource) Add the name of a shareable JNDI resource, which this factory is allowed to cache once obtained.booleancontainsBean(String name) booleancontainsBeanDefinition(String beanName) <A extends Annotation>
cn.taketoday.core.annotation.MergedAnnotation<A>findAnnotationOnBean(String beanName, Class<A> annotationType) <A extends Annotation>
cn.taketoday.core.annotation.MergedAnnotation<A>findAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit) <A extends Annotation>
AfindSynthesizedAnnotation(String beanName, Class<A> annotationType) String[]getAliases(String name) <T> T<T> T<T> TgetBeanDefinition(String beanName) intString[]getBeanNamesForAnnotation(Class<? extends Annotation> annotationType) getBeanNamesForType(cn.taketoday.core.ResolvableType type) getBeanNamesForType(cn.taketoday.core.ResolvableType requiredType, boolean includeNonSingletons, boolean allowEagerInit) getBeanNamesForType(Class<?> requiredType, boolean includeNonSingletons) getBeansOfType(cn.taketoday.core.ResolvableType requiredType, boolean includeNonSingletons, boolean allowEagerInit) getBeansWithAnnotation(Class<? extends Annotation> annotationType, boolean includeNonSingletons) <T> ObjectProvider<T>getObjectSupplier(cn.taketoday.core.ResolvableType requiredType) <T> ObjectSupplier<T>getObjectSupplier(cn.taketoday.core.ResolvableType requiredType, boolean allowEagerInit) <T> ObjectSupplier<T>getObjectSupplier(Class<T> requiredType) <T> ObjectSupplier<T>getObjectSupplier(Class<T> requiredType, boolean allowEagerInit) Class<?>Class<?>booleanisPrototype(String name) booleanisSingleton(String name) booleanisTypeMatch(String name, cn.taketoday.core.ResolvableType typeToMatch) booleanisTypeMatch(String name, Class<?> typeToMatch) voidsetShareableResources(String... shareableResources) Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.从类继承的方法 cn.taketoday.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef从类继承的方法 cn.taketoday.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.beans.factory.BeanFactory
getAnnotatedBeans, getBeanNamesForType, getBeanNamesForType, getBeans, getBeansOfType, getBeansOfType, getBeansWithAnnotation, unwrap
-
构造器详细资料
-
SimpleJndiBeanFactory
public SimpleJndiBeanFactory()
-
-
方法详细资料
-
getBean
- 指定者:
getBean在接口中BeanFactory- 抛出:
BeansException
-
getBean
- 指定者:
getBean在接口中BeanFactory- 抛出:
BeansException
-
getBean
- 指定者:
getBean在接口中BeanFactory- 抛出:
BeansException
-
getBean
- 指定者:
getBean在接口中BeanFactory- 抛出:
BeansException
-
getBean
- 指定者:
getBean在接口中BeanFactory- 抛出:
BeansException
-
getObjectSupplier
- 指定者:
getObjectSupplier在接口中BeanFactory
-
getObjectSupplier
- 指定者:
getObjectSupplier在接口中BeanFactory
-
containsBean
- 指定者:
containsBean在接口中BeanFactory
-
isSingleton
- 指定者:
isSingleton在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
isPrototype
- 指定者:
isPrototype在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
isTypeMatch
public boolean isTypeMatch(String name, cn.taketoday.core.ResolvableType typeToMatch) throws NoSuchBeanDefinitionException - 指定者:
isTypeMatch在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
isTypeMatch
public boolean isTypeMatch(String name, @Nullable Class<?> typeToMatch) throws NoSuchBeanDefinitionException - 指定者:
isTypeMatch在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
getType
- 指定者:
getType在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
getType
@Nullable public Class<?> getType(String name, boolean allowFactoryBeanInit) throws NoSuchBeanDefinitionException - 指定者:
getType在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
getAliases
- 指定者:
getAliases在接口中BeanFactory
-
findSynthesizedAnnotation
@Nullable public <A extends Annotation> A findSynthesizedAnnotation(String beanName, Class<A> annotationType) throws NoSuchBeanDefinitionException -
findAnnotationOnBean
public <A extends Annotation> cn.taketoday.core.annotation.MergedAnnotation<A> findAnnotationOnBean(String beanName, Class<A> annotationType) throws NoSuchBeanDefinitionException - 指定者:
findAnnotationOnBean在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
findAnnotationOnBean
public <A extends Annotation> cn.taketoday.core.annotation.MergedAnnotation<A> findAnnotationOnBean(String beanName, Class<A> annotationType, boolean allowFactoryBeanInit) throws NoSuchBeanDefinitionException - 指定者:
findAnnotationOnBean在接口中BeanFactory- 抛出:
NoSuchBeanDefinitionException
-
containsBeanDefinition
- 指定者:
containsBeanDefinition在接口中BeanFactory
-
getBeanDefinition
- 指定者:
getBeanDefinition在接口中BeanFactory
-
getBeansWithAnnotation
public Map<String,Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType, boolean includeNonSingletons) throws BeansException - 指定者:
getBeansWithAnnotation在接口中BeanFactory- 抛出:
BeansException
-
getBeansOfType
public <T> Map<String,T> getBeansOfType(cn.taketoday.core.ResolvableType requiredType, boolean includeNonSingletons, boolean allowEagerInit) - 指定者:
getBeansOfType在接口中BeanFactory
-
getBeanNamesForType
- 指定者:
getBeanNamesForType在接口中BeanFactory
-
getBeanNamesForType
- 指定者:
getBeanNamesForType在接口中BeanFactory
-
getBeanNamesForType
public Set<String> getBeanNamesForType(cn.taketoday.core.ResolvableType requiredType, boolean includeNonSingletons, boolean allowEagerInit) - 指定者:
getBeanNamesForType在接口中BeanFactory
-
getBeanNamesForAnnotation
- 指定者:
getBeanNamesForAnnotation在接口中BeanFactory
-
getObjectSupplier
- 指定者:
getObjectSupplier在接口中BeanFactory
-
getObjectSupplier
public <T> ObjectSupplier<T> getObjectSupplier(cn.taketoday.core.ResolvableType requiredType, boolean allowEagerInit) - 指定者:
getObjectSupplier在接口中BeanFactory
-
getBeanDefinitionCount
public int getBeanDefinitionCount()- 指定者:
getBeanDefinitionCount在接口中BeanFactory
-
getBeanDefinitionNames
- 指定者:
getBeanDefinitionNames在接口中BeanFactory
-
getBeanDefinitions
- 指定者:
getBeanDefinitions在接口中BeanFactory
-
getInjector
- 指定者:
getInjector在接口中DependencyInjectorProvider