org.springframework.beans.factory.access
Class JndiBeanFactoryLocator
java.lang.Object
org.springframework.beans.factory.access.JndiBeanFactoryLocator
- All Implemented Interfaces:
- BeanFactoryLocator
- Direct Known Subclasses:
- ContextJndiBeanFactoryLocator
- public class JndiBeanFactoryLocator
- extends java.lang.Object
- implements BeanFactoryLocator
BeanFactoryLocator implementation that creates the BeanFactory
from file locations specified as JNDI environment variable.
This default implementation creates a DefaultListableBeanFactory,
populated via an XmlBeanDefinitionReader. Subclasses may override
createFactory for custom instantiation.
- Version:
- $Revision: 1.2 $
- Author:
- Rod Johnson, Colin Sampaleanu
- See Also:
DefaultListableBeanFactory
Field Summary |
static java.lang.String |
BEAN_FACTORY_PATH_DELIMITERS
Any number of these characters are considered delimiters
between multiple bean factory paths in a single-String value. |
protected org.apache.commons.logging.Log |
logger
|
Method Summary |
protected BeanFactoryReference |
createBeanFactory(java.lang.String[] resources)
Actually create the BeanFactory, given an array of classpath resource strings
which should be combined. |
BeanFactoryReference |
useBeanFactory(java.lang.String factoryKey)
Load/use a bean factory, as specified by a factoryKey which is a JNDI address,
of the form java:comp/env/ejb/BeanFactoryPath . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BEAN_FACTORY_PATH_DELIMITERS
public static final java.lang.String BEAN_FACTORY_PATH_DELIMITERS
- Any number of these characters are considered delimiters
between multiple bean factory paths in a single-String value.
- See Also:
- Constant Field Values
logger
protected org.apache.commons.logging.Log logger
JndiBeanFactoryLocator
public JndiBeanFactoryLocator()
useBeanFactory
public BeanFactoryReference useBeanFactory(java.lang.String factoryKey)
throws BeansException
- Load/use a bean factory, as specified by a factoryKey which is a JNDI address,
of the form
java:comp/env/ejb/BeanFactoryPath
.
- Specified by:
useBeanFactory
in interface BeanFactoryLocator
- Parameters:
factoryKey
- a resource name specifying which BeanFactory the BeanFactoryLocator
should return for usage. The actual meaning of the resource name is specific to the
actual implementation of BeanFactoryLocator.
- Returns:
- the BeanFactory instance, wrapped as a BeanFactoryReference object
- Throws:
BeansException
- if there is an error loading or accessing the BeanFactory
createBeanFactory
protected BeanFactoryReference createBeanFactory(java.lang.String[] resources)
throws BeansException
- Actually create the BeanFactory, given an array of classpath resource strings
which should be combined. This is split out as a separate method so that subclasses
can override the actual type uses (to be an ApplicationContext, for example).
- Parameters:
resources
- an array of Strings representing classpath resource names
- Returns:
- the created BeanFactory, wrapped in a BeanFactoryReference
- Throws:
BeansException
Copyright (C) 2003-2004 The Spring Framework Project.