org.springframework.ldap.core.support
Class BaseLdapPathBeanPostProcessor
java.lang.Object
org.springframework.ldap.core.support.BaseLdapPathBeanPostProcessor
- All Implemented Interfaces:
- org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware
public class BaseLdapPathBeanPostProcessor
- extends java.lang.Object
- implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware
This BeanPostProcessor
checks each bean if it implements
BaseLdapPathAware
. If it does, the deafult context base LDAP path
will be determined, and that value will be injected to the
BaseLdapPathAware.setBaseLdapPath(DistinguishedName)
method of the
processed bean.
If the baseLdapPath
property of this
BeanPostProcessor
is set, that value will be used. Otherwise,
in order to determine which base LDAP path to supply to the instance the
ApplicationContext
is searched for any beans that are
implementations of BaseLdapPathSource
. If one single occurrance
is found, that instance is queried for its base path, and that is what will
be injected. If more than one BaseLdapPathSource
instance is
configured in the ApplicationContext
, the name of the one to
use will need to be specified to the baseLdapPathSourceName
property; otherwise the post processing will fail. If no
BaseLdapPathSource
implementing bean is found in the context and
the basePath
property is not set, post processing will also
fail.
- Since:
- 1.2
- Author:
- Mattias Arthursson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseLdapPathBeanPostProcessor
public BaseLdapPathBeanPostProcessor()
postProcessBeforeInitialization
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
- Specified by:
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
- Throws:
org.springframework.beans.BeansException
postProcessAfterInitialization
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
- Specified by:
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
- Throws:
org.springframework.beans.BeansException
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
setBasePath
public void setBasePath(DistinguishedName basePath)
- Set the base path to be injected in all
BaseLdapPathAware
beans.
If this property is not set, the default base path will be determined
from any defined BaseLdapPathSource
instances available in the
ApplicationContext
.
- Parameters:
basePath
- the base path.
setBaseLdapPathSourceName
public void setBaseLdapPathSourceName(java.lang.String contextSourceName)
- Set the name of the
ContextSource
bean to use for getting
the base path. This method is typically useful if several ContextSource
instances have been configured.
- Parameters:
contextSourceName
- the name of the ContextSource
bean to use for determining the base path.
Copyright � 2002-2006. All Rights Reserved.