code: protected DirContext getContext(DirContextType dirContextType) {
  		final DirContext dirContext;
  		try {
  			dirContext = (DirContext) this.keyedObjectPool.borrowObject(dirContextType);
  		}
  		catch (Exception e) {
  			throw new DataAccessResourceFailureException("Failed to borrow DirContext from pool.", e);
  		}
  
  		if (dirContext instanceof LdapContext) {
  			return new DelegatingLdapContext(this.keyedObjectPool, (LdapContext) dirContext, dirContextType);
  		}
  
  		return new DelegatingDirContext(this.keyedObjectPool, dirContext, dirContextType);
  	}
docs: Gets a DirContext of the specified type from the keyed object pool.
  
  @param dirContextType The type of context to return.
  @return A wrapped DirContext of the specified type.
  @throws DataAccessResourceFailureException If retrieving the object from
  the pool throws an exception