Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » jndi » support » [javadoc | source]
org.springframework.jndi.support
public class: SimpleJndiBeanFactory [javadoc | source]
java.lang.Object
   org.springframework.jndi.JndiAccessor
      org.springframework.jndi.JndiLocatorSupport
         org.springframework.jndi.support.SimpleJndiBeanFactory

All Implemented Interfaces:
    BeanFactory

Simple JNDI-based implementation of Spring's org.springframework.beans.factory.BeanFactory interface. Does not support enumerating bean definitions, hence doesn't implement the org.springframework.beans.factory.ListableBeanFactory interface.

This factory resolves given bean names as JNDI names within the J2EE 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 Spring's org.springframework.context.annotation.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.

Fields inherited from org.springframework.jndi.JndiLocatorSupport:
CONTAINER_PREFIX
Fields inherited from org.springframework.jndi.JndiAccessor:
logger
Constructor:
 public SimpleJndiBeanFactory() 
Method from org.springframework.jndi.support.SimpleJndiBeanFactory Summary:
addShareableResource,   containsBean,   getAliases,   getBean,   getBean,   getBean,   getType,   isPrototype,   isSingleton,   isTypeMatch,   setShareableResources
Methods from org.springframework.jndi.JndiLocatorSupport:
convertJndiName,   isResourceRef,   lookup,   lookup,   setResourceRef
Methods from org.springframework.jndi.JndiAccessor:
getJndiEnvironment,   getJndiTemplate,   setJndiEnvironment,   setJndiTemplate
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.jndi.support.SimpleJndiBeanFactory Detail:
 public  void addShareableResource(String shareableResource) 
    Add the name of a shareable JNDI resource, which this factory is allowed to cache once obtained.
 public boolean containsBean(String name) 
 public String[] getAliases(String name) 
 public Object getBean(String name) throws BeansException 
 public Object getBean(String name,
    Class requiredType) throws BeansException 
 public Object getBean(String name,
    Object[] args) throws BeansException 
 public Class getType(String name) throws NoSuchBeanDefinitionException 
 public boolean isPrototype(String name) throws NoSuchBeanDefinitionException 
 public boolean isSingleton(String name) throws NoSuchBeanDefinitionException 
 public boolean isTypeMatch(String name,
    Class targetType) throws NoSuchBeanDefinitionException 
 public  void setShareableResources(String[] shareableResources) 
    Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.