类 LocalDataSourceServiceImpl

  • 所有已实现的接口:
    DataSourceService

    public class LocalDataSourceServiceImpl
    extends java.lang.Object
    implements DataSourceService
    local data source.
    作者:
    Nacos
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean checkMasterWritable()
      Check master db.
      void cleanAndReopenDerby()
      Clean and reopen Derby.
      private void doDerbyClean()  
      private void execute​(java.sql.Connection conn, java.lang.String sqlFile)
      Execute sql.
      java.lang.String getCurrentDbUrl()
      Get current db url.
      javax.sql.DataSource getDatasource()  
      java.lang.String getHealth()
      Get heath information.
      org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
      Get jdbc template.
      org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
      Get transaction template.
      void init()
      Initialize the relevant resource information.
      private void initialize​(java.lang.String jdbcUrl)  
      private java.util.List<java.lang.String> loadSql​(java.lang.String sqlFile)
      Load sql.
      void reload()
      Reload.
      void restoreDerby​(java.lang.String jdbcUrl, java.util.concurrent.Callable<java.lang.Void> callable)
      Restore derby.
      void setHealthStatus​(java.lang.String healthStatus)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • jdbcDriverName

        private final java.lang.String jdbcDriverName
        另请参阅:
        常量字段值
      • userName

        private final java.lang.String userName
        另请参阅:
        常量字段值
      • password

        private final java.lang.String password
        另请参阅:
        常量字段值
      • derbyBaseDir

        private final java.lang.String derbyBaseDir
      • derbyShutdownErrMsg

        private final java.lang.String derbyShutdownErrMsg
        另请参阅:
        常量字段值
      • jt

        private volatile org.springframework.jdbc.core.JdbcTemplate jt
      • tjt

        private volatile org.springframework.transaction.support.TransactionTemplate tjt
      • initialize

        private boolean initialize
      • jdbcTemplateInit

        private boolean jdbcTemplateInit
      • healthStatus

        private java.lang.String healthStatus
    • 构造器详细资料

      • LocalDataSourceServiceImpl

        public LocalDataSourceServiceImpl()
    • 方法详细资料

      • init

        @PostConstruct
        public void init()
                  throws java.lang.Exception
        从接口复制的说明: DataSourceService
        Initialize the relevant resource information.
        指定者:
        init 在接口中 DataSourceService
        抛出:
        java.lang.Exception - exception.
      • getDatasource

        public javax.sql.DataSource getDatasource()
      • cleanAndReopenDerby

        public void cleanAndReopenDerby()
                                 throws java.lang.Exception
        Clean and reopen Derby.
        抛出:
        java.lang.Exception - exception.
      • restoreDerby

        public void restoreDerby​(java.lang.String jdbcUrl,
                                 java.util.concurrent.Callable<java.lang.Void> callable)
                          throws java.lang.Exception
        Restore derby.
        参数:
        jdbcUrl - jdbcUrl string value.
        callable - callable.
        抛出:
        java.lang.Exception - exception.
      • doDerbyClean

        private void doDerbyClean()
                           throws java.lang.Exception
        抛出:
        java.lang.Exception
      • initialize

        private void initialize​(java.lang.String jdbcUrl)
      • getTransactionTemplate

        public org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
        从接口复制的说明: DataSourceService
        Get transaction template.
        指定者:
        getTransactionTemplate 在接口中 DataSourceService
        返回:
        TransactionTemplate.
      • setHealthStatus

        public void setHealthStatus​(java.lang.String healthStatus)
      • loadSql

        private java.util.List<java.lang.String> loadSql​(java.lang.String sqlFile)
                                                  throws java.lang.Exception
        Load sql.
        参数:
        sqlFile - sql.
        返回:
        sqls.
        抛出:
        java.lang.Exception - Exception.
      • execute

        private void execute​(java.sql.Connection conn,
                             java.lang.String sqlFile)
                      throws java.lang.Exception
        Execute sql.
        参数:
        conn - connect.
        sqlFile - sql.
        抛出:
        java.lang.Exception - Exception.