throws Exception {
// The spec says to return null if we can't create an instance
// of the reference
DriverAdapterCPDS cpds = null;
if (refObj instanceof Reference) {
Reference ref = (Reference)refObj;
if (ref.getClassName().equals(getClass().getName())) {
RefAddr ra = ref.get("description");
if (ra != null && ra.getContent() != null) {
setDescription(ra.getContent().toString());
}
ra = ref.get("driver");
if (ra != null && ra.getContent() != null) {
setDriver(ra.getContent().toString());
}
ra = ref.get("url");
if (ra != null && ra.getContent() != null) {
setUrl(ra.getContent().toString());
}
ra = ref.get("user");
if (ra != null && ra.getContent() != null) {
setUser(ra.getContent().toString());
}
ra = ref.get("password");
if (ra != null && ra.getContent() != null) {
setPassword(ra.getContent().toString());
}
ra = ref.get("poolPreparedStatements");
if (ra != null && ra.getContent() != null) {
setPoolPreparedStatements(Boolean.valueOf(
ra.getContent().toString()).booleanValue());
}
ra = ref.get("maxActive");
if (ra != null && ra.getContent() != null) {
setMaxActive(Integer.parseInt(ra.getContent().toString()));
}
ra = ref.get("maxIdle");
if (ra != null && ra.getContent() != null) {
setMaxIdle(Integer.parseInt(ra.getContent().toString()));
}
ra = ref.get("timeBetweenEvictionRunsMillis");
if (ra != null && ra.getContent() != null) {
setTimeBetweenEvictionRunsMillis(
Integer.parseInt(ra.getContent().toString()));
}
ra = ref.get("numTestsPerEvictionRun");
if (ra != null && ra.getContent() != null) {
setNumTestsPerEvictionRun(
Integer.parseInt(ra.getContent().toString()));
}
ra = ref.get("minEvictableIdleTimeMillis");
if (ra != null && ra.getContent() != null) {
setMinEvictableIdleTimeMillis(
Integer.parseInt(ra.getContent().toString()));
}
ra = ref.get("maxPreparedStatements");
if (ra != null && ra.getContent() != null) {
setMaxPreparedStatements(
Integer.parseInt(ra.getContent().toString()));
}