List of usage examples for org.springframework.jdbc.datasource.lookup DataSourceLookupFailureException DataSourceLookupFailureException
public DataSourceLookupFailureException(String msg)
From source file:com.rockagen.gnext.dao.hb.BaseDao.java
/** * Sets the hibernate sessionFactory./*from ww w . j a v a2 s .co m*/ * * @param sessionFactory * hibernate sessionFactory. */ @Resource public void setSessionFactory(SessionFactory sessionFactory) { if (sessionFactory == null) { throw new DataSourceLookupFailureException("sessionFactory must not be empty or null"); } this.sessionFactory = sessionFactory; }
From source file:com.ge.predix.acs.monitoring.AcsDBHealthIndicatorTest.java
@DataProvider public Object[][] dp() { TitanMigrationManager happyMigrationManager = new TitanMigrationManager(); TitanMigrationManager sadMigrationManager = new TitanMigrationManager(); Whitebox.setInternalState(happyMigrationManager, "isMigrationComplete", true); Whitebox.setInternalState(sadMigrationManager, "isMigrationComplete", false); return new Object[][] { new Object[] { mockDBWithUp(), Status.UP, happyMigrationManager }, { mockDBWithException(new TransientDataAccessResourceException("")), new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager }, { mockDBWithException(new QueryTimeoutException("")), new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager }, { mockDBWithException(new DataSourceLookupFailureException("")), new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager }, { mockDBWithException(new PermissionDeniedDataAccessException("", null)), new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager }, { mockDBWithUp(), new Status(AcsMonitoringConstants.ACS_DB_MIGRATION_INCOMPLETE), sadMigrationManager }, };/*from w w w . j av a 2s . c om*/ }
From source file:com.rockagen.gnext.service.spring.QueryObjectGenericServImpl.java
/** * Get Session//from w w w . j a v a 2s . com * * @return session */ private Session obtainSession() { if (sessionFactory == null) { throw new DataSourceLookupFailureException("sessionFactory must not be empty or null"); } return sessionFactory.getCurrentSession(); }