Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /* package */
 final synchronized Message findMessageById(int msgId) throws NoSuchFieldException {
   Message msg = null;
   for (int i = 0; i < elementCount; i++) {
     if ((msg = (Message) elementData[i]) == null) {
       throw new NoSuchFieldException();
     }
     if (msg.getMessageID() == msgId) {
       return msg;
     }
   }
   throw new NoSuchFieldException();
 }