Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 16482 invoked from network); 2 Mar 2010 18:36:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Mar 2010 18:36:06 -0000 Received: (qmail 91324 invoked by uid 500); 2 Mar 2010 18:36:01 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 91279 invoked by uid 500); 2 Mar 2010 18:36:01 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 91270 invoked by uid 99); 2 Mar 2010 18:36:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 18:36:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 18:35:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 734C823889E5; Tue, 2 Mar 2010 18:35:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r918138 - /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java Date: Tue, 02 Mar 2010 18:35:38 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100302183538.734C823889E5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kayyagari Date: Tue Mar 2 18:35:38 2010 New Revision: 918138 URL: http://svn.apache.org/viewvc?rev=918138&view=rev Log: o added a global flag to detect the completion of the search operation o fixed the close() method Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java?rev=918138&r1=918137&r2=918138&view=diff ============================================================================== --- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java (original) +++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java Tue Mar 2 18:35:38 2010 @@ -54,6 +54,7 @@ /** a reference to hold the retrieved SearchResponse object from SearchFuture */ private SearchResponse response; + private boolean done; public SearchCursor( SearchFuture future, long timeout, TimeUnit timeUnit ) { @@ -93,7 +94,7 @@ throw new LdapException( LdapConnection.TIME_OUT_ERROR ); } - boolean done = ( response instanceof SearchResultDone ); + done = ( response instanceof SearchResultDone ); if ( done ) { @@ -137,6 +138,12 @@ @Override public void close( Exception cause ) throws Exception { + if( done ) + { + super.close(); + return; + } + if ( !future.isCancelled() ) { future.cancel( true );