@@ -0,0 +1,2364 @@
+/*%0A * Copyright 2016 The Netty Project%0A *%0A * The Netty Project licenses this file to you under the Apache License,%0A * version 2.0 (the %22License%22); you may not use this file except in compliance%0A * with the License. You may obtain a copy of the License at:%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage io.netty.handler.ssl;%0A%0Aimport io.netty.buffer.ByteBufAllocator;%0Aimport io.netty.util.internal.ObjectUtil;%0A%0Aimport javax.net.ssl.SSLEngine;%0Aimport javax.net.ssl.SSLSessionContext;%0Aimport java.util.List;%0A%0A/**%0A * Adapter class which allows to wrap another %7B@link SslContext%7D and init %7B@link SSLEngine%7D instances.%0A */%0Apublic abstract class DelegatingSslContext extends SslContext %7B%0A%0A    private final SslContext ctx;%0A%0A    protected DelegatingSslContext(SslContext ctx) %7B%0A        this.ctx = ObjectUtil.checkNotNull(ctx, %22ctx%22);%0A    %7D%0A%0A    @Override%0A    public final boolean isClient() %7B%0A        return ctx.isClient();%0A    %7D%0A%0A    @Override%0A    public final List%3CString%3E cipherSuites() %7B%0A        return ctx.cipherSuites();%0A    %7D%0A%0A    @Override%0A    public final long sessionCacheSize() %7B%0A        return ctx.sessionCacheSize();%0A    %7D%0A%0A    @Override%0A    public final long sessionTimeout() %7B%0A        return ctx.sessionTimeout();%0A    %7D%0A%0A    @Override%0A    public final ApplicationProtocolNegotiator applicationProtocolNegotiator() %7B%0A        return ctx.applicationProtocolNegotiator();%0A    %7D%0A%0A    @Override%0A    public final SSLEngine newEngine(ByteBufAllocator alloc) %7B%0A        SSLEngine engine = ctx.newEngine(alloc);%0A        initEngine(engine);%0A        return engine;%0A    %7D%0A%0A    @Override%0A    public final SSLEngine newEngine(ByteBufAllocator alloc, String peerHost, int peerPort) %7B%0A        SSLEngine engine = ctx.newEngine(alloc, peerHost, peerPort);%0A        initEngine(engine);%0A        return engine;%0A    %7D%0A%0A    @Override%0A    public final SSLSessionContext sessionContext() %7B%0A        return ctx.sessionContext();%0A    %7D%0A%0A    /**%0A     * Init the %7B@link SSLEngine%7D.%0A     */%0A    protected abstract void initEngine(SSLEngine engine);%0A%7D%0A

Allow to wrap another SslContext implementation and do extra init steps on the SSLEngine.