DynamicSourceGeneratorInterface.java 558 B

12345678910111213141516171819202122232425262728
  1. package jnpf.database.plugins;
  2. import jnpf.database.util.DataSourceUtil;
  3. /**
  4. * 动态生成数据源接口
  5. *
  6. * @author JNPF开发平台组
  7. * @copyright 引迈信息技术有限公司
  8. */
  9. public interface DynamicSourceGeneratorInterface {
  10. /**
  11. * 获取当前需要切换的数据源配置
  12. * @return
  13. */
  14. DataSourceUtil getDataSource();
  15. /**
  16. * 是否缓存链接
  17. * @return true: 不可用时重新获取, false: 每次都重新获取配置
  18. */
  19. default boolean cachedConnection(){
  20. return true;
  21. }
  22. }