Class BaseLdapPathBeanPostProcessor
- java.lang.Object
-
- org.springframework.ldap.core.support.BaseLdapPathBeanPostProcessor
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.config.BeanPostProcessor,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered
public class BaseLdapPathBeanPostProcessor extends java.lang.Object implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware, org.springframework.core.OrderedThisBeanPostProcessorchecks each bean if it implementsBaseLdapNameAwareorBaseLdapPathAware. If it does, the default context base LDAP path will be determined, and that value will be injected to theBaseLdapNameAware.setBaseLdapPath(javax.naming.ldap.LdapName)orBaseLdapPathAware.setBaseLdapPath(DistinguishedName)method of the processed bean.If the
baseLdapPathproperty of thisBeanPostProcessoris set, that value will be used. Otherwise, in order to determine which base LDAP path to supply to the instance theApplicationContextis searched for any beans that are implementations ofBaseLdapPathSource. If one single occurrence is found, that instance is queried for its base path, and that is what will be injected. If more than oneBaseLdapPathSourceinstance is configured in theApplicationContext, the name of the one to use will need to be specified to thebaseLdapPathSourceNameproperty; otherwise the post processing will fail. If noBaseLdapPathSourceimplementing bean is found in the context and thebasePathproperty is not set, post processing will also fail.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description BaseLdapPathBeanPostProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetOrder()java.lang.ObjectpostProcessAfterInitialization(java.lang.Object bean, java.lang.String beanName)java.lang.ObjectpostProcessBeforeInitialization(java.lang.Object bean, java.lang.String beanName)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetBaseLdapPathSourceName(java.lang.String contextSourceName)Set the name of theContextSourcebean to use for getting the base path.voidsetBasePath(java.lang.String basePath)voidsetBasePath(DistinguishedName basePath)Deprecated.DistinguishedNameand associated classes and methods are deprecated as of 2.0.voidsetOrder(int order)Set the order value of this object for sorting purposes.
-
-
-
Method Detail
-
postProcessBeforeInitialization
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean, java.lang.String beanName)- Specified by:
postProcessBeforeInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor
-
postProcessAfterInitialization
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean, java.lang.String beanName)- Specified by:
postProcessAfterInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setBasePath
public void setBasePath(DistinguishedName basePath)
Deprecated.DistinguishedNameand associated classes and methods are deprecated as of 2.0.Set the base path to be injected in allBaseLdapPathAwarebeans. If this property is not set, the default base path will be determined from any definedBaseLdapPathSourceinstances available in theApplicationContext.- Parameters:
basePath- the base path.
-
setBasePath
public void setBasePath(java.lang.String basePath)
-
setBaseLdapPathSourceName
public void setBaseLdapPathSourceName(java.lang.String contextSourceName)
Set the name of theContextSourcebean to use for getting the base path. This method is typically useful if several ContextSource instances have been configured.- Parameters:
contextSourceName- the name of theContextSourcebean to use for determining the base path.
-
setOrder
public void setOrder(int order)
Set the order value of this object for sorting purposes.- Parameters:
order- the order of this instance. Defaults toOrdered.LOWEST_PRECEDENCE.- Since:
- 1.3.2
- See Also:
Ordered
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
-