From 1cff6738bed5f9bfb7c2443088e8b00f7d4d7491 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 25 Jun 2009 09:55:00 +0000 Subject: [PATCH] Made HttpTunnelingSocketChannelConfig public to allow an access to the SslContext property --- .../HttpTunnelingSocketChannelConfig.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingSocketChannelConfig.java b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingSocketChannelConfig.java index 81e222d085..e7c2a2b87c 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingSocketChannelConfig.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingSocketChannelConfig.java @@ -27,15 +27,37 @@ import java.util.Map; import javax.net.ssl.SSLContext; import org.jboss.netty.buffer.ChannelBufferFactory; +import org.jboss.netty.channel.ChannelConfig; import org.jboss.netty.channel.ChannelPipelineFactory; +import org.jboss.netty.channel.socket.SocketChannel; import org.jboss.netty.channel.socket.SocketChannelConfig; /** + * The {@link ChannelConfig} of a client-side HTTP tunneling + * {@link SocketChannel}. A {@link SocketChannel} created by + * {@link HttpTunnelingClientSocketChannelFactory} will return an instance of + * this configuration type for {@link SocketChannel#getConfig()}. + * + *

Available options

+ * + * In addition to the options provided by {@link SocketChannelConfig}, + * {@link HttpTunnelingSocketChannelConfig} allows the following options in + * the option map: + * + * + * + * + * + * + * + *
NameAssociated setter method
{@code "sslContext"}{@link #setSslContext(SSLContext)}
+ * * @author The Netty Project (netty-dev@lists.jboss.org) * @author Andy Taylor (andy.taylor@jboss.org) + * @author Trustin Lee (tlee@redhat.com) * @version $Rev$, $Date$ */ -final class HttpTunnelingSocketChannelConfig implements SocketChannelConfig { +public final class HttpTunnelingSocketChannelConfig implements SocketChannelConfig { private final HttpTunnelingClientSocketChannel channel; private volatile SSLContext sslContext; @@ -47,10 +69,18 @@ final class HttpTunnelingSocketChannelConfig implements SocketChannelConfig { this.channel = channel; } + /** + * Returns the {@link SSLContext} which is used to establish an HTTPS + * connection. If {@code null}, a plain-text HTTP connection is established. + */ public SSLContext getSslContext() { return sslContext; } + /** + * Sets the {@link SSLContext} which is used to establish an HTTPS connection. + * If {@code null}, a plain-text HTTP connection is established. + */ public void setSslContext(SSLContext sslContext) { this.sslContext = sslContext; }