/** * Set the ContextSource to work on. Even though the actual ContextSource * sent to the LdapTemplate instance should be a * {@link TransactionAwareContextSourceProxy}, the one sent to this method * should be the target of that proxy. If it is not, the target will be * extracted and used instead. * * @param contextSource * the ContextSource to work on. */ public void setContextSource(ContextSource contextSource) { if (contextSource instanceof TransactionAwareContextSourceProxy) { TransactionAwareContextSourceProxy proxy = (TransactionAwareContextSourceProxy) contextSource; this.contextSource = proxy.getTarget(); } else { this.contextSource = contextSource; } if (contextSource instanceof AbstractContextSource) { AbstractContextSource abstractContextSource = (AbstractContextSource) contextSource; if(abstractContextSource.isAnonymousReadOnly()) { throw new IllegalArgumentException( "Compensating LDAP transactions cannot be used when context-source is anonymous-read-only"); } } }
/** * Set the ContextSource to work on. Even though the actual ContextSource * sent to the LdapTemplate instance should be a * {@link TransactionAwareContextSourceProxy}, the one sent to this method * should be the target of that proxy. If it is not, the target will be * extracted and used instead. * * @param contextSource * the ContextSource to work on. */ public void setContextSource(ContextSource contextSource) { if (contextSource instanceof TransactionAwareContextSourceProxy) { TransactionAwareContextSourceProxy proxy = (TransactionAwareContextSourceProxy) contextSource; this.contextSource = proxy.getTarget(); } else { this.contextSource = contextSource; } if (contextSource instanceof AbstractContextSource) { AbstractContextSource abstractContextSource = (AbstractContextSource) contextSource; if(abstractContextSource.isAnonymousReadOnly()) { throw new IllegalArgumentException( "Compensating LDAP transactions cannot be used when context-source is anonymous-read-only"); } } }
/** * Set the ContextSource to work on. Even though the actual ContextSource * sent to the LdapTemplate instance should be a * {@link TransactionAwareContextSourceProxy}, the one sent to this method * should be the target of that proxy. If it is not, the target will be * extracted and used instead. * * @param contextSource * the ContextSource to work on. */ public void setContextSource(ContextSource contextSource) { if (contextSource instanceof TransactionAwareContextSourceProxy) { TransactionAwareContextSourceProxy proxy = (TransactionAwareContextSourceProxy) contextSource; this.contextSource = proxy.getTarget(); } else { this.contextSource = contextSource; } if (contextSource instanceof AbstractContextSource) { AbstractContextSource abstractContextSource = (AbstractContextSource) contextSource; if(abstractContextSource.isAnonymousReadOnly()) { throw new IllegalArgumentException( "Compensating LDAP transactions cannot be used when context-source is anonymous-read-only"); } } }
/** * Set the ContextSource to work on. Even though the actual ContextSource * sent to the LdapTemplate instance should be a * {@link TransactionAwareContextSourceProxy}, the one sent to this method * should be the target of that proxy. If it is not, the target will be * extracted and used instead. * * @param contextSource * the ContextSource to work on. */ public void setContextSource(ContextSource contextSource) { if (contextSource instanceof TransactionAwareContextSourceProxy) { TransactionAwareContextSourceProxy proxy = (TransactionAwareContextSourceProxy) contextSource; this.contextSource = proxy.getTarget(); } else { this.contextSource = contextSource; } if (contextSource instanceof AbstractContextSource) { AbstractContextSource abstractContextSource = (AbstractContextSource) contextSource; if(abstractContextSource.isAnonymousReadOnly()) { throw new IllegalArgumentException( "Compensating LDAP transactions cannot be used when context-source is anonymous-read-only"); } } }