@Component public class DataSourceAspect extends Object
Created by wuwenbin on 2017/1/3.
| 构造器和说明 |
|---|
DataSourceAspect(DaoFactory daoFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
dynamicDataSourceAspect()
define point aspect,if a method has
DynamicDataSource annotation,it starts aop method to filter it |
void |
rollbackDataSource2Default(org.aspectj.lang.JoinPoint joinPoint)
after method to switch back dataSource to default
|
void |
switchDataSource(org.aspectj.lang.JoinPoint joinPoint)
before method to switch dataSource
|
@Autowired public DataSourceAspect(DaoFactory daoFactory)
public void dynamicDataSourceAspect()
DynamicDataSource annotation,it starts aop method to filter itpublic void switchDataSource(org.aspectj.lang.JoinPoint joinPoint)
throws NoSuchMethodException,
DataSourceKeyNotExistException
#joinPoint - joinPointNoSuchMethodExceptionDataSourceKeyNotExistExceptionpublic void rollbackDataSource2Default(org.aspectj.lang.JoinPoint joinPoint)
throws NoSuchMethodException
#joinPoint - NoSuchMethodExceptionCopyright © 2019. All rights reserved.