@Override @Nullable public Object getTarget() { try { if (this.lookupOnStartup || !this.cache) { return (this.cachedObject != null ? this.cachedObject : lookup()); } else { synchronized (this) { if (this.cachedObject == null) { this.cachedObject = lookup(); } return this.cachedObject; } } } catch (NamingException ex) { throw new JndiLookupFailureException("JndiObjectTargetSource failed to obtain new target object", ex); } }
@Override public void afterPropertiesSet() throws NamingException { super.afterPropertiesSet(); if (this.lookupOnStartup) { Object object = lookup(); if (this.cache) { this.cachedObject = object; } else { this.targetClass = object.getClass(); } } }
@Override @Nullable public Object getTarget() { try { if (this.lookupOnStartup || !this.cache) { return (this.cachedObject != null ? this.cachedObject : lookup()); } else { synchronized (this) { if (this.cachedObject == null) { this.cachedObject = lookup(); } return this.cachedObject; } } } catch (NamingException ex) { throw new JndiLookupFailureException("JndiObjectTargetSource failed to obtain new target object", ex); } }
@Override public void afterPropertiesSet() throws NamingException { super.afterPropertiesSet(); if (this.lookupOnStartup) { Object object = lookup(); if (this.cache) { this.cachedObject = object; } else { this.targetClass = object.getClass(); } } }
@Override @Nullable public Object getTarget() { try { if (this.lookupOnStartup || !this.cache) { return (this.cachedObject != null ? this.cachedObject : lookup()); } else { synchronized (this) { if (this.cachedObject == null) { this.cachedObject = lookup(); } return this.cachedObject; } } } catch (NamingException ex) { throw new JndiLookupFailureException("JndiObjectTargetSource failed to obtain new target object", ex); } }
@Override public void afterPropertiesSet() throws NamingException { super.afterPropertiesSet(); if (this.lookupOnStartup) { Object object = lookup(); if (this.cache) { this.cachedObject = object; } else { this.targetClass = object.getClass(); } } }