mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
09.41.2007 9ddb8a08f2e80d9a9eaae5f03d93106ec792138c
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
@@ -65,6 +65,7 @@
  private static final String PORT = "ldap.port";
  private static final String HOST = "ldap.host";
  private static final long serialVersionUID = -3748022009593442973L;
  private static final AtomicInteger nextMessageID = new AtomicInteger(1);
  private Unmarshaller unmarshaller;
  private Marshaller marshaller;
@@ -303,7 +304,7 @@
      }
    } finally {
      if (connection != null) {
        connection.close(new AtomicInteger(1));
        connection.close(nextMessageID);
      }
    }
  }
@@ -347,5 +348,25 @@
    reply.writeTo(os);
    os.flush();
  }
  /**
   * Retrieves a message ID that may be used for the next LDAP message sent to
   * the Directory Server.
   *
   * @return  A message ID that may be used for the next LDAP message sent to
   *          the Directory Server.
   */
  public static int nextMessageID()
  {
    int nextID = nextMessageID.getAndIncrement();
    if (nextID == Integer.MAX_VALUE)
    {
      nextMessageID.set(1);
    }
    return nextID;
  }
}