code: public synchronized void setLdapTemplate(final LdapTemplate ldapTemplate) {
          Assert.notNull(ldapTemplate, "ldapTemplate cannot be null");
          this.ldapTemplate = ldapTemplate;
          this.contextSource = this.ldapTemplate.getContextSource();
      }
docs: Sets the LdapTemplate, and thus the ContextSource (implicitly).
  
  @param ldapTemplate the LdapTemplate to query the LDAP server from.  CANNOT be NULL.