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.pcep.impl;
10 import javax.annotation.concurrent.ThreadSafe;
12 import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
13 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
14 import org.opendaylight.protocol.pcep.spi.PCEPProviderContext;
15 import org.opendaylight.protocol.pcep.spi.SubobjectHandlerRegistry;
16 import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
22 public final class SingletonPCEPProviderContext implements PCEPProviderContext {
23 private static final class Holder {
24 private static final PCEPProviderContext INSTANCE = new SingletonPCEPProviderContext();
27 private final MessageHandlerRegistry msgReg = new SimpleMessageHandlerFactory();
28 private final ObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
29 private final SubobjectHandlerRegistry subobjReg = new SimpleSubobjectHandlerFactory();
30 private final TlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();
32 private SingletonPCEPProviderContext() {
36 public static PCEPProviderContext getInstance() {
37 return Holder.INSTANCE;
41 public MessageHandlerRegistry getMessageHandlerRegistry() {
46 public ObjectHandlerRegistry getObjectHandlerRegistry() {
51 public SubobjectHandlerRegistry getSubobjectHandlerRegistry() {
56 public TlvHandlerRegistry getTlvHandlerRegistry() {