2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.server;
10 import io.netty.channel.ChannelFuture;
11 import io.netty.channel.EventLoopGroup;
12 import io.netty.channel.local.LocalAddress;
13 import io.netty.channel.local.LocalServerChannel;
14 import java.net.InetSocketAddress;
15 import org.opendaylight.netconf.api.NetconfServerDispatcher;
16 import org.opendaylight.netconf.nettyutil.AbstractNetconfDispatcher;
18 public class NetconfServerDispatcherImpl extends AbstractNetconfDispatcher<NetconfServerSession,
19 NetconfServerSessionListener> implements NetconfServerDispatcher {
20 private final ServerChannelInitializer initializer;
22 public NetconfServerDispatcherImpl(final ServerChannelInitializer serverChannelInitializer,
23 final EventLoopGroup bossGroup, final EventLoopGroup workerGroup) {
24 super(bossGroup, workerGroup);
25 initializer = serverChannelInitializer;
29 public ChannelFuture createServer(final InetSocketAddress address) {
30 return super.createServer(address, initializer::initialize);
34 public ChannelFuture createLocalServer(final LocalAddress address) {
35 return super.createServer(address, LocalServerChannel.class, initializer::initialize);