/** * Set the backend ConnectionPoolDataSource. This property should not be set if using jndi to * access the datasource. * * @param v Value to assign to connectionPoolDataSource. */ public void setConnectionPoolDataSource(ConnectionPoolDataSource v) { assertInitializationAllowed(); if (dataSourceName != null) { throw new IllegalStateException("Cannot set the DataSource, if JNDI is used."); } if (dataSource != null) { throw new IllegalStateException("The CPDS has already been set. It cannot be altered."); } dataSource = v; instanceKey = InstanceKeyDataSourceFactory.registerNewInstance(this); }
/** * Set the name of the ConnectionPoolDataSource which backs this pool. This name is used to look * up the datasource from a jndi service provider. * * @param v Value to assign to dataSourceName. */ public void setDataSourceName(String v) { assertInitializationAllowed(); if (dataSource != null) { throw new IllegalStateException( "Cannot set the JNDI name for the DataSource, if already " + "set using setConnectionPoolDataSource."); } if (dataSourceName != null) { throw new IllegalStateException( "The DataSourceName has already been set. " + "It cannot be altered."); } this.dataSourceName = v; instanceKey = InstanceKeyDataSourceFactory.registerNewInstance(this); }