/** * The timeout thread. If it wakes from the sleep, future input * is stopped and the request is timed out. */ public final void run() { try { if( Debug.LDAP_DEBUG) { Debug.trace( Debug.messages, message.name + "client timer started, " + timeToWait + " milliseconds"); } sleep(timeToWait); message.acceptReplies = false; if( Debug.LDAP_DEBUG) { Debug.trace( Debug.messages, message.name + "client timed out"); } // Note: Abandon clears the bind semaphore after failed bind. message.abandon( null, new InterThreadException("Client request timed out", null, LDAPException.LDAP_TIMEOUT, null, message)); } catch ( InterruptedException ie ) { if( Debug.LDAP_DEBUG) { Debug.trace( Debug.messages, message.name + "timer stopped"); } // the timer was stopped, do nothing } return; } }
info.abandon( cons, null);
/** * Abandon all requests on this MessageAgent */ /* package */ final void abandonAll() { int size = messages.size(); Message info; for( int i = 0; i < size; i++ ) { info = (Message)messages.elementAt(i); // Message complete and no more replies, remove from id list if( Debug.LDAP_DEBUG) { Debug.trace( Debug.messages, name + "abandonAll: Removing abandoned Message(" + info.getMessageID() + ")"); } messages.removeElement( info); info.abandon( null, null); } if( Debug.LDAP_DEBUG) { Debug.trace( Debug.messages, name + "Messages in queue"); debugDisplayMessages(); } return; }
info.abandon( null, notifyUser); // also notifies the application