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.protocol.bgp.rib.impl;
10 import java.io.Closeable;
11 import java.io.IOException;
13 import org.opendaylight.protocol.bgp.parser.BGPMessageParser;
14 import org.opendaylight.protocol.bgp.parser.BGPSession;
15 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPConnection;
16 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
18 import org.opendaylight.protocol.framework.Dispatcher;
21 * Implementation of BGPDispatcher.
23 public final class BGPDispatcherImpl implements BGPDispatcher, Closeable {
25 private final Dispatcher dispatcher;
27 public BGPDispatcherImpl(final Dispatcher dispatcher) throws IOException {
28 this.dispatcher = dispatcher;
32 public BGPSession createClient(final BGPConnection connection, final BGPMessageParser parser) throws IOException {
33 return (BGPSession) this.dispatcher.createClient(connection, new BGPSessionFactory(parser), BGPInputStream.FACTORY);
36 public Dispatcher getDispatcher() {
37 return this.dispatcher;
42 // This is only necessary for configuration interaction