Remove OSGiBindingAdapterFactory
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / StaticConfiguration.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.binding.dom.adapter;
9
10 import org.slf4j.LoggerFactory;
11
12 /**
13  * Static JVM-wide configuration.
14  */
15 final class StaticConfiguration {
16     /**
17      * When we are invoking a Binding-Aware RPC implementation, we can side-step translation through NormalizedNodes,
18      * which is an obvious performance win.
19      *
20      * <p>
21      * Unfortunately Binding Specification does not truthfully cover YANG semantics, in that grouping instantiations
22      * are not treated separately, which leads to constructs which are Binding-valid, but are actually YANG-invalid.
23      * These are usually easily rectified when identified, but the existence of this shortcut means that in single-node
24      * scenario we do not detect these mismatches and thus these issues remain unidentified -- only to break when
25      * in multi-node scenarios or the shortcut becomes otherwise ineffective.
26      *
27      * <p>
28      * We therefore allow the shortcuts to be globally disabled via a property, which is evaluated when this component
29      * loads.
30      */
31     static final boolean ENABLE_CODEC_SHORTCUT = !Boolean.getBoolean(
32         "org.opendaylight.mdsal.binding.dom.adapter.disableCodecShortcut");
33
34     static {
35         // Do not retain the logger
36         LoggerFactory.getLogger(StaticConfiguration.class).info("Binding-over-DOM codec shortcuts are {}",
37                 ENABLE_CODEC_SHORTCUT ? "enabled" : "disabled");
38     }
39
40     private StaticConfiguration() {
41
42     }
43 }