use of org.codehaus.plexus.component.repository.exception.ComponentLookupException in project x-pipe by ctripcorp.
the class DcClusterDao method postConstruct.
@PostConstruct
private void postConstruct() {
try {
dcClusterTblDao = ContainerLoader.getDefaultContainer().lookup(DcClusterTblDao.class);
dcClusterShardTblDao = ContainerLoader.getDefaultContainer().lookup(DcClusterShardTblDao.class);
} catch (ComponentLookupException e) {
throw new ServerException("Cannot construct dao.", e);
}
}
use of org.codehaus.plexus.component.repository.exception.ComponentLookupException in project x-pipe by ctripcorp.
the class RedisDao method postConstruct.
@PostConstruct
private void postConstruct() {
try {
redisTblDao = ContainerLoader.getDefaultContainer().lookup(RedisTblDao.class);
dcClusterShardTblDao = ContainerLoader.getDefaultContainer().lookup(DcClusterShardTblDao.class);
} catch (ComponentLookupException e) {
throw new ServerException("Cannot construct dao.", e);
}
}
use of org.codehaus.plexus.component.repository.exception.ComponentLookupException in project x-pipe by ctripcorp.
the class H2Init method executeSqlScript.
protected void executeSqlScript(String prepareSql) throws ComponentLookupException, SQLException {
DataSourceManager dsManager = ContainerLoader.getDefaultContainer().lookup(DataSourceManager.class);
Connection conn = null;
PreparedStatement stmt = null;
try {
conn = dsManager.getDataSource(DATA_SOURCE).getConnection();
conn.setAutoCommit(false);
if (!Strings.isEmpty(prepareSql)) {
for (String sql : prepareSql.split(";")) {
logger.debug("[setup][data]{}", sql.trim());
stmt = conn.prepareStatement(sql);
stmt.executeUpdate();
}
}
conn.commit();
} catch (Exception ex) {
logger.error("[SetUpTestDataSource][fail]:", ex);
if (null != conn) {
conn.rollback();
}
} finally {
if (null != stmt) {
stmt.close();
}
if (null != conn) {
conn.setAutoCommit(true);
conn.close();
}
}
}
use of org.codehaus.plexus.component.repository.exception.ComponentLookupException in project x-pipe by ctripcorp.
the class DalTransactionAspect method postConstruct.
@PostConstruct
private void postConstruct() {
try {
transactionManager = ContainerLoader.getDefaultContainer().lookup(TransactionManager.class, ROLE_HINT);
logger.info("[postConstruct]Load TransactionManager: {}", transactionManager.getClass());
} catch (ComponentLookupException e) {
throw new ServerException("Cannot find transaction manager.", e);
}
}
use of org.codehaus.plexus.component.repository.exception.ComponentLookupException in project x-pipe by ctripcorp.
the class ShardDao method postConstruct.
@PostConstruct
private void postConstruct() {
try {
clusterTblDao = ContainerLoader.getDefaultContainer().lookup(ClusterTblDao.class);
dcClusterTblDao = ContainerLoader.getDefaultContainer().lookup(DcClusterTblDao.class);
shardTblDao = ContainerLoader.getDefaultContainer().lookup(ShardTblDao.class);
dcClusterShardTblDao = ContainerLoader.getDefaultContainer().lookup(DcClusterShardTblDao.class);
} catch (ComponentLookupException e) {
throw new ServerException("Cannot construct dao.", e);
}
}
Aggregations