4 * Generated from: yang module name: bgp-rib-impl yang module local name: bgp-message-factory-impl
5 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6 * Generated at: Wed Nov 06 13:02:31 CET 2013
8 * Do not modify this file unless it is present under src/main directory
10 package org.opendaylight.controller.config.yang.bgp.rib.impl;
12 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
13 import org.opendaylight.protocol.bgp.parser.BGPMessageFactory;
14 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
15 import org.opendaylight.protocol.bgp.parser.impl.BGPMessageFactoryImpl;
16 import org.opendaylight.yangtools.yang.binding.Notification;
21 public final class BGPMessageFactoryImplModule
23 org.opendaylight.controller.config.yang.bgp.rib.impl.AbstractBGPMessageFactoryImplModule {
25 public BGPMessageFactoryImplModule(
26 final org.opendaylight.controller.config.api.ModuleIdentifier name,
27 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
28 super(name, dependencyResolver);
31 public BGPMessageFactoryImplModule(
32 final org.opendaylight.controller.config.api.ModuleIdentifier name,
33 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
34 final BGPMessageFactoryImplModule oldModule,
35 final java.lang.AutoCloseable oldInstance) {
36 super(name, dependencyResolver, oldModule, oldInstance);
40 public void validate() {
42 // Add custom validation for module attributes here.
46 public java.lang.AutoCloseable createInstance() {
48 return new BGPMessageFactoryCloseable(new BGPMessageFactoryImpl(
49 getBgpExtensionsDependency().getMessageRegistry()));
50 } catch (Exception e) {
51 throw new RuntimeException("Failed to create consumer context.", e);
55 private static class BGPMessageFactoryCloseable implements
56 BGPMessageFactory, AutoCloseable {
57 private final BGPMessageFactoryImpl inner;
59 public BGPMessageFactoryCloseable(
60 final BGPMessageFactoryImpl bgpMessageFactory) {
61 this.inner = bgpMessageFactory;
65 public void close() throws Exception {
70 public Notification parse(final byte[] bytes) throws BGPParsingException, BGPDocumentedException {
71 return inner.parse(bytes);
75 public byte[] put(final Notification bgpMessage) {
76 return inner.put(bgpMessage);