Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2012-05-25 13:41:30 +0000
committerSimone Bordet2012-05-25 13:41:30 +0000
commit0ccfd0e1981575c41b5c14566667e0191f9cc1cc (patch)
treeb5a50f179b83047eaff3419e83c1039cf5f41521
parent2ca1a08d848de87702330c7c90c1360e3f573cec (diff)
downloadorg.eclipse.jetty.project-0ccfd0e1981575c41b5c14566667e0191f9cc1cc.tar.gz
org.eclipse.jetty.project-0ccfd0e1981575c41b5c14566667e0191f9cc1cc.tar.xz
org.eclipse.jetty.project-0ccfd0e1981575c41b5c14566667e0191f9cc1cc.zip
Added remove methods to NextProtoNego, and updated version to 1.1.0-SNAPSHOT.
-rw-r--r--jetty-npn/pom.xml2
-rw-r--r--jetty-npn/src/main/java/org/eclipse/jetty/npn/NextProtoNego.java29
2 files changed, 29 insertions, 2 deletions
diff --git a/jetty-npn/pom.xml b/jetty-npn/pom.xml
index 063dffda7a..0f2d211d59 100644
--- a/jetty-npn/pom.xml
+++ b/jetty-npn/pom.xml
@@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jetty.npn</groupId>
<artifactId>npn-api</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<name>Jetty :: Next Protocol Negotiation :: API</name>
<scm>
diff --git a/jetty-npn/src/main/java/org/eclipse/jetty/npn/NextProtoNego.java b/jetty-npn/src/main/java/org/eclipse/jetty/npn/NextProtoNego.java
index 3db7950ef8..10d7b66171 100644
--- a/jetty-npn/src/main/java/org/eclipse/jetty/npn/NextProtoNego.java
+++ b/jetty-npn/src/main/java/org/eclipse/jetty/npn/NextProtoNego.java
@@ -87,7 +87,8 @@ import javax.net.ssl.SSLSocket;
* </pre>
* <p>There is no need to unregister {@link SSLSocket} or {@link SSLEngine} instances, as they
* are kept in a {@link WeakHashMap} and will be garbage collected when the application does not
- * hard reference them anymore.</p>
+ * hard reference them anymore. However, methods to explicitly unregister {@link SSLSocket} or
+ * {@link SSLEngine} instances are provided.</p>
* <p>In order to help application development, you can set the {@link NextProtoNego#debug} field
* to {@code true} to have debug code printed to {@link System#err}.</p>
*/
@@ -109,6 +110,7 @@ public class NextProtoNego
*
* @param socket the socket to register with the provider
* @param provider the provider to register with the socket
+ * @see #remove(SSLSocket)
*/
public static void put(SSLSocket socket, Provider provider)
{
@@ -125,10 +127,23 @@ public class NextProtoNego
}
/**
+ * <p>Unregisters the given SSLSocket.</p>
+ *
+ * @param socket the socket to unregister
+ * @return the provider registered with the socket
+ * @see #put(SSLSocket, Provider)
+ */
+ public static Provider remove(SSLSocket socket)
+ {
+ return objects.remove(socket);
+ }
+
+ /**
* <p>Registers a SSLEngine with a provider.</p>
*
* @param engine the engine to register with the provider
* @param provider the provider to register with the engine
+ * @see #remove(SSLEngine)
*/
public static void put(SSLEngine engine, Provider provider)
{
@@ -146,6 +161,18 @@ public class NextProtoNego
}
/**
+ * <p>Unregisters the given SSLEngine.</p>
+ *
+ * @param engine the engine to unregister
+ * @return the provider registered with the engine
+ * @see #put(SSLEngine, Provider)
+ */
+ public static Provider remove(SSLEngine engine)
+ {
+ return objects.remove(engine);
+ }
+
+ /**
* <p>Base, empty, interface for providers.</p>
*/
public interface Provider

Back to the top