类 ContextJndiBeanFactoryLocator
- java.lang.Object
- org.springframework.jndi.JndiAccessor
- org.springframework.jndi.JndiLocatorSupport
- org.springframework.context.access.ContextJndiBeanFactoryLocator
- 所有已实现的接口:
BeanFactoryLocator
public class ContextJndiBeanFactoryLocator extends JndiLocatorSupport implements BeanFactoryLocator
BeanFactoryLocator implementation that creates the BeanFactory from one or more classpath locations specified in a JNDI environment variable.This default implementation creates a
ClassPathXmlApplicationContext
. Subclasses may overridecreateBeanFactory(java.lang.String[])
for custom instantiation.- 作者:
- Colin Sampaleanu, Juergen Hoeller
- 另请参阅:
createBeanFactory(java.lang.String[])
字段概要
字段 修饰符和类型 字段 说明 static String
BEAN_FACTORY_PATH_DELIMITERS
Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.从类继承的字段 org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
从类继承的字段 org.springframework.jndi.JndiAccessor
logger
构造器概要
构造器 构造器 说明 ContextJndiBeanFactoryLocator()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected ApplicationContext
createApplicationContext(String[] resources)
Create the ApplicationContext instance, given an array of class path resource Strings which should be combinedprotected BeanFactoryReference
createBeanFactory(String[] resources)
Create the BeanFactory instance, given an array of class path resource Strings which should be combined.BeanFactoryReference
useBeanFactory(String factoryKey)
Load/use a bean factory, as specified by a factory key which is a JNDI address, of the formjava:comp/env/ejb/BeanFactoryPath
.从类继承的方法 org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
从类继承的方法 org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
字段详细资料
BEAN_FACTORY_PATH_DELIMITERS
public static final String BEAN_FACTORY_PATH_DELIMITERS
Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.- 另请参阅:
- 常量字段值
构造器详细资料
ContextJndiBeanFactoryLocator
public ContextJndiBeanFactoryLocator()
方法详细资料
useBeanFactory
public BeanFactoryReference useBeanFactory(String factoryKey) throws BeansException
Load/use a bean factory, as specified by a factory key which is a JNDI address, of the formjava:comp/env/ejb/BeanFactoryPath
. The contents of this JNDI location must be a string containing one or more classpath resource names (separated by any of the delimiters ',; \t\n
' if there is more than one. The resulting BeanFactory (or ApplicationContext) will be created from the combined resources.- 指定者:
useBeanFactory
在接口中BeanFactoryLocator
- 参数:
factoryKey
- a resource name specifying whichBeanFactory
theBeanFactoryLocator
must return for usage. The actual meaning of the resource name is specific to the implementation ofBeanFactoryLocator
.- 返回:
- the
BeanFactory
instance, wrapped as aBeanFactoryReference
object - 抛出:
BeansException
- if there is an error loading or accessing theBeanFactory
- 另请参阅:
createBeanFactory(java.lang.String[])
createBeanFactory
protected BeanFactoryReference createBeanFactory(String[] resources) throws BeansException
Create the BeanFactory instance, given an array of class path resource Strings which should be combined. This is split out as a separate method so that subclasses can override the actual BeanFactory implementation class.Delegates to
createApplicationContext
by default, wrapping the result in a ContextBeanFactoryReference.- 参数:
resources
- an array of Strings representing classpath resource names- 返回:
- the created BeanFactory, wrapped in a BeanFactoryReference (for example, a ContextBeanFactoryReference wrapping an ApplicationContext)
- 抛出:
BeansException
- if factory creation failed- 另请参阅:
createApplicationContext(java.lang.String[])
,ContextBeanFactoryReference
createApplicationContext
protected ApplicationContext createApplicationContext(String[] resources) throws BeansException
Create the ApplicationContext instance, given an array of class path resource Strings which should be combined- 参数:
resources
- an array of Strings representing classpath resource names- 返回:
- the created ApplicationContext
- 抛出:
BeansException
- if context creation failed