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

Jean-Noel Rouvignac
07.51.2013 6b867820726b09d56252cdf58abeac6cd90d0901
opends/src/server/org/opends/server/util/StaticUtils.java
@@ -64,6 +64,9 @@
import java.util.StringTokenizer;
import java.util.TimeZone;
import javax.naming.NamingException;
import javax.naming.ldap.InitialLdapContext;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.messages.MessageDescriptor;
@@ -4669,6 +4672,10 @@
   */
  public static void close(Selector... selectors)
  {
    if (selectors == null)
    {
      return;
    }
    for (Selector selector : selectors)
    {
      if (selector != null)
@@ -4696,6 +4703,10 @@
   */
  public static void close(Socket... sockets)
  {
    if (sockets == null)
    {
      return;
    }
    for (Socket socket : sockets)
    {
      if (socket != null)
@@ -4713,6 +4724,34 @@
  }
  /**
   * Closes the provided {@link InitialLdapContext}s ignoring any errors which
   * occurred.
   *
   * @param ctxs
   *          The contexts to be closed, which may be <code>null</code>.
   */
  public static void close(InitialLdapContext... ctxs)
  {
    if (ctxs == null)
    {
      return;
    }
    for (InitialLdapContext ctx : ctxs)
    {
      if (ctx != null)
      {
        try
        {
          ctx.close();
        }
        catch (NamingException ignored)
        {
        }
      }
    }
  }
  /**
   * Calls {@link Thread#sleep(long)}, surrounding it with the mandatory
   * <code>try</code> / <code>catch(InterruptedException)</code> block.
   *