public class

ContextJndiBeanFactoryLocator

extends JndiLocatorSupport
implements BeanFactoryLocator
java.lang.Object
   ↳ org.springframework.jndi.JndiAccessor
     ↳ org.springframework.jndi.JndiLocatorSupport
       ↳ org.springframework.context.access.ContextJndiBeanFactoryLocator

Class Overview

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 override createBeanFactory(String[]) for custom instantiation.

Summary

Constants
String BEAN_FACTORY_PATH_DELIMITERS Any number of these characters are considered delimiters between multiple bean factory config paths in a single String value.
[Expand]
Inherited Constants
From class org.springframework.jndi.JndiLocatorSupport
[Expand]
Inherited Fields
From class org.springframework.jndi.JndiAccessor
Public Constructors
ContextJndiBeanFactoryLocator()
Public Methods
BeanFactoryReference useBeanFactory(String factoryKey)
Load/use a bean factory, as specified by a factory key which is a JNDI address, of the form java:comp/env/ejb/BeanFactoryPath.
Protected Methods
ApplicationContext createApplicationContext(String[] resources)
Create the ApplicationContext instance, given an array of class path resource Strings which should be combined
BeanFactoryReference createBeanFactory(String[] resources)
Create the BeanFactory instance, given an array of class path resource Strings which should be combined.
[Expand]
Inherited Methods
From class org.springframework.jndi.JndiLocatorSupport
From class org.springframework.jndi.JndiAccessor
From class java.lang.Object
From interface org.springframework.beans.factory.access.BeanFactoryLocator

Constants

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.

Constant Value: ",; "

Public Constructors

public ContextJndiBeanFactoryLocator ()

Public Methods

public BeanFactoryReference useBeanFactory (String factoryKey)

Load/use a bean factory, as specified by a factory key which is a JNDI address, of the form java: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.

Parameters
factoryKey a resource name specifying which BeanFactory the BeanFactoryLocator must return for usage. The actual meaning of the resource name is specific to the implementation of BeanFactoryLocator.
Returns

Protected Methods

protected ApplicationContext createApplicationContext (String[] resources)

Create the ApplicationContext instance, given an array of class path resource Strings which should be combined

Parameters
resources an array of Strings representing classpath resource names
Returns
  • the created ApplicationContext
Throws
BeansException if context creation failed

protected BeanFactoryReference createBeanFactory (String[] resources)

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.

Parameters
resources an array of Strings representing classpath resource names
Returns
  • the created BeanFactory, wrapped in a BeanFactoryReference (for example, a ContextBeanFactoryReference wrapping an ApplicationContext)
Throws
BeansException if factory creation failed