public DataSource getDataSource(StoreContext ctx) { Log log = getLog(LOG_RUNTIME); DataSource ds = null; if(ctx != null && StringUtils.isNotEmpty(ctx.getConnectionFactoryName())) { ds = getDataSource(ctx, (DataSource) ctx.getConnectionFactory()); // fail fast if a cfName has been provided, but was not available in JNDI if (ds == null) { throw new UserException(_loc.get("invalid-datasource", ctx.getConnectionFactoryName())).setFatal(true); } if(! (ds instanceof DecoratingDataSource)) { ds = DataSourceFactory.decorateDataSource(ds, this, false); } if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from StoreContext using jndiName: " + ctx.getConnectionFactory2Name()); } return ds; } else { ds = getDataSource(ctx, (DataSource) getConnectionFactory()); if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from configuration. StoreContext: " + ctx ); } return ds; } }
public DataSource getDataSource(StoreContext ctx) { Log log = getLog(LOG_RUNTIME); DataSource ds = null; if(ctx != null && StringUtils.isNotEmpty(ctx.getConnectionFactoryName())) { ds = getDataSource(ctx, (DataSource) ctx.getConnectionFactory()); // fail fast if a cfName has been provided, but was not available in JNDI if (ds == null) { throw new UserException(_loc.get("invalid-datasource", ctx.getConnectionFactoryName())).setFatal(true); } if(! (ds instanceof DecoratingDataSource)) { ds = DataSourceFactory.decorateDataSource(ds, this, false); } if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from StoreContext using jndiName: " + ctx.getConnectionFactory2Name()); } return ds; } else { ds = getDataSource(ctx, (DataSource) getConnectionFactory()); if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from configuration. StoreContext: " + ctx ); } return ds; } }
public DataSource getDataSource(StoreContext ctx) { Log log = getLog(LOG_RUNTIME); DataSource ds = null; if(ctx != null && StringUtil.isNotEmpty(ctx.getConnectionFactoryName())) { ds = getDataSource(ctx, (DataSource) ctx.getConnectionFactory()); // fail fast if a cfName has been provided, but was not available in JNDI if (ds == null) { throw new UserException(_loc.get("invalid-datasource", ctx.getConnectionFactoryName())).setFatal(true); } if(! (ds instanceof DecoratingDataSource)) { ds = DataSourceFactory.decorateDataSource(ds, this, false); } if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from StoreContext using jndiName: " + ctx.getConnectionFactory2Name()); } return ds; } else { ds = getDataSource(ctx, (DataSource) getConnectionFactory()); if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from configuration. StoreContext: " + ctx ); } return ds; } }
public DataSource getDataSource(StoreContext ctx) { Log log = getLog(LOG_RUNTIME); DataSource ds = null; if(ctx != null && StringUtil.isNotEmpty(ctx.getConnectionFactoryName())) { ds = getDataSource(ctx, (DataSource) ctx.getConnectionFactory()); // fail fast if a cfName has been provided, but was not available in JNDI if (ds == null) { throw new UserException(_loc.get("invalid-datasource", ctx.getConnectionFactoryName())).setFatal(true); } if(! (ds instanceof DecoratingDataSource)) { ds = DataSourceFactory.decorateDataSource(ds, this, false); } if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from StoreContext using jndiName: " + ctx.getConnectionFactory2Name()); } return ds; } else { ds = getDataSource(ctx, (DataSource) getConnectionFactory()); if (log.isTraceEnabled()) { log.trace("Found datasource1: " + ds + " from configuration. StoreContext: " + ctx ); } return ds; } }