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.parser.impl;
10 import org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry;
11 import org.opendaylight.protocol.bgp.parser.spi.AttributeRegistry;
12 import org.opendaylight.protocol.bgp.parser.spi.CapabilityRegistry;
13 import org.opendaylight.protocol.bgp.parser.spi.MessageRegistry;
14 import org.opendaylight.protocol.bgp.parser.spi.NlriRegistry;
15 import org.opendaylight.protocol.bgp.parser.spi.ParameterRegistry;
16 import org.opendaylight.protocol.bgp.parser.spi.ProviderContext;
17 import org.opendaylight.protocol.bgp.parser.spi.SubsequentAddressFamilyRegistry;
19 public final class SingletonProviderContext implements ProviderContext {
20 private static final class Holder {
21 private static final ProviderContext INSTANCE = new SingletonProviderContext();
24 private SingletonProviderContext() {
28 public static ProviderContext getInstance() {
29 return Holder.INSTANCE;
33 public AddressFamilyRegistry getAddressFamilyRegistry() {
34 return SimpleAddressFamilyRegistry.getInstance();
38 public AttributeRegistry getAttributeRegistry() {
39 return SimpleAttributeRegistry.getInstance();
43 public CapabilityRegistry getCapabilityRegistry() {
44 return SimpleCapabilityRegistry.getInstance();
48 public MessageRegistry getMessageRegistry() {
49 return SimpleMessageRegistry.getInstance();
53 public NlriRegistry getNlriRegistry() {
54 return SimpleNlriRegistry.getInstance();
58 public ParameterRegistry getParameterRegistry() {
59 return SimpleParameterRegistry.getInstance();
63 public SubsequentAddressFamilyRegistry getSubsequentAddressFamilyRegistry() {
64 return SimpleSubsequentAddressFamilyRegistry.getInstance();