<commit_before>/*
 * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.protocol.pcep.impl;

import javax.annotation.concurrent.ThreadSafe;

import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.PCEPProviderContext;
import org.opendaylight.protocol.pcep.spi.SubobjectHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;

/**
 *
 */
@ThreadSafe
public final class SingletonPCEPProviderContext implements PCEPProviderContext {
	private static final class Holder {
		private static final PCEPProviderContext INSTANCE = new SingletonPCEPProviderContext();
	}

	private final LabelHandlerRegistry labelReg = new SimpleLabelHandlerRegistry();
	private final MessageHandlerRegistry msgReg = new SimpleMessageHandlerRegistry();
	private final ObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
	private final SubobjectHandlerRegistry subobjReg =  new SimpleSubobjectHandlerFactory();
	private final TlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();

	private SingletonPCEPProviderContext() {

	}

	public static PCEPProviderContext getInstance() {
		return Holder.INSTANCE;
	}

	@Override
	public LabelHandlerRegistry getHandlerRegistry() {
		return labelReg;<commit_msg>BUG-113: make sure the singleton is initialized<commit_after>/*
 * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.protocol.pcep.impl;

import javax.annotation.concurrent.ThreadSafe;

import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.PCEPProviderContext;
import org.opendaylight.protocol.pcep.spi.SubobjectHandlerRegistry;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;

/**
 *
 */
@ThreadSafe
public final class SingletonPCEPProviderContext implements PCEPProviderContext {
	private static final class Holder {
		private static final PCEPProviderContext INSTANCE;

		static {
			final PCEPProviderContext pc = new SingletonPCEPProviderContext();
			new PCEPImplActivator().start(pc);
			INSTANCE = pc;
		}
	}

	private final LabelHandlerRegistry labelReg = new SimpleLabelHandlerRegistry();
	private final MessageHandlerRegistry msgReg = new SimpleMessageHandlerRegistry();
	private final ObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
	private final SubobjectHandlerRegistry subobjReg =  new SimpleSubobjectHandlerFactory();
	private final TlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();

	private SingletonPCEPProviderContext() {

	}

	public static PCEPProviderContext getInstance() {
		return Holder.INSTANCE;
	}

	@Override
	public LabelHandlerRegistry getHandlerRegistry() {
		return labelReg;
{'fraction_non_alphanumeric': 0.07431850789096127, 'fraction_numerical': 0.0054519368723099, 'mean_word_length': 6.028225806451613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6965968', 'n_tokens_mistral': 991, 'n_tokens_neox': 944, 'n_words': 249}