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.impl;
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 {
21 private final ServerChannelInitializer initializer;
23 public NetconfServerDispatcherImpl(ServerChannelInitializer serverChannelInitializer, EventLoopGroup bossGroup,
24 EventLoopGroup workerGroup) {
25 super(bossGroup, workerGroup);
26 this.initializer = serverChannelInitializer;
30 public ChannelFuture createServer(InetSocketAddress address) {
31 return super.createServer(address, initializer::initialize);
35 public ChannelFuture createLocalServer(LocalAddress address) {
36 return super.createServer(address, LocalServerChannel.class, initializer::initialize);