Package org.appng.core.repository.config
Class ApplicationPostProcessor
- java.lang.Object
-
- org.appng.core.repository.config.ApplicationPostProcessor
-
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor
,org.springframework.core.Ordered
public class ApplicationPostProcessor extends Object implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered
ABeanFactoryPostProcessor
that configures thedatasource
bean which is of typeDataSource
, but only if theApplication
requires a database.
Additionally, theSite
and theApplication
are also registered as beans.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Constructor Description ApplicationPostProcessor(Site site, Application application, DatabaseConnection databaseConnection, org.springframework.cache.CacheManager platformCacheManager, Collection<String> dictionaryNames)
Creates a newApplicationPostProcessor
using the givenDatabaseConnection
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOrder()
void
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
If thisApplicationPostProcessor
was created with a non-null
DatabaseConnection
, aDatasourceConfigurer
is configured using thatDatabaseConnection
.
-
-
-
Constructor Detail
-
ApplicationPostProcessor
public ApplicationPostProcessor(Site site, Application application, DatabaseConnection databaseConnection, org.springframework.cache.CacheManager platformCacheManager, Collection<String> dictionaryNames)
Creates a newApplicationPostProcessor
using the givenDatabaseConnection
.- Parameters:
site
- theSite
application
- theApplication
databaseConnection
- aDatabaseConnection
, may benull
.platformCacheManager
- the platform'sCacheManager
dictionaryNames
- the name of the dictionary files that theApplication
uses (seeAbstractResourceBasedMessageSource.setBasenames(String...)
)
-
-
Method Detail
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
If thisApplicationPostProcessor
was created with a non-null
DatabaseConnection
, aDatasourceConfigurer
is configured using thatDatabaseConnection
. Otherwise, thedatasource
bean gets destroyed.- Specified by:
postProcessBeanFactory
in interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor
- Throws:
org.springframework.beans.BeansException
- See Also:
DatasourceConfigurer
-
getOrder
public int getOrder()
- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
-