From bc247971096268630f67130974fccbb3a6e23be5 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 19 Mar 2013 09:11:48 +0000
Subject: [PATCH] OPENDJ-808 Implement a simple commons REST based HTTP connection handler
---
opends/src/server/org/opends/server/util/StaticUtils.java | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/StaticUtils.java b/opends/src/server/org/opends/server/util/StaticUtils.java
index 699de07..45f528d 100644
--- a/opends/src/server/org/opends/server/util/StaticUtils.java
+++ b/opends/src/server/org/opends/server/util/StaticUtils.java
@@ -4639,6 +4639,33 @@
}
/**
+ * Closes the provided {@link Selector}'s ignoring any errors which occurred.
+ * <p>
+ * With java 7 we will be able to use {@link StaticUtils#close(Closeable...)}
+ * </p>
+ *
+ * @param selectors
+ * The selectors to be closed, which may be <code>null</code>.
+ */
+ public static void close(Selector... selectors)
+ {
+ for (Selector selector : selectors)
+ {
+ if (selector != null)
+ {
+ try
+ {
+ selector.close();
+ }
+ catch (IOException ignored)
+ {
+ // Ignore.
+ }
+ }
+ }
+ }
+
+ /**
* Returns an {@link Iterable} returning the passed in {@link Iterator}. THis
* allows using methods returning Iterators with foreach statements.
* <p>
--
Gitblit v1.10.0