private void chooseDelegate() {
if (delegate != null) {
return;
}
JNDIConnectionSource jndiCS = new JNDIConnectionSource();
jndiCS.setJndiLocation(jndiLocation);
try {
Context ctx = new InitialContext();
Object obj = ctx.lookup(jndiCS.getJndiLocation());
PortableRemoteObject.narrow(obj, DataSource.class);
delegate = jndiCS;
addInfo("DataSource obtained from " + jndiLocation);