aboutsummaryrefslogtreecommitdiffstats
path: root/cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java
diff options
context:
space:
mode:
authorHansen, Tony (th1395) <th1395@att.com>2018-03-29 12:57:06 +0000
committerHansen, Tony (th1395) <th1395@att.com>2018-03-29 12:57:23 +0000
commitbd5129dbad044907bd1818b2f8cda3c60da9b3e8 (patch)
treeedc355d63e440a87a1c97ad65357681f279e6ba0 /cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java
parent4e1b45a2e3e474606965ca3b66bd5f82f526b0ce (diff)
remove most of this code for R2 Beijing
This package is not being used in R2 Beijing because of the move to Kubernetes with OOM. If you need this package, use the R1 Amsterdam release packages. I'm not removing the repo though because it is likely that we will need to add things in R3 Casablanca. Change-Id: I40a46886cfa2f3803f97918ad5cea149f5fcf696 Signed-off-by: Hansen, Tony (th1395) <th1395@att.com> Issue-ID: CCSDK-231
Diffstat (limited to 'cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java')
-rw-r--r--cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java106
1 files changed, 0 insertions, 106 deletions
diff --git a/cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java b/cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java
deleted file mode 100644
index f108ced..0000000
--- a/cdf/src/cdf-prop-value/cdf-util/src/main/java/org/onap/dcae/cdf/util/config/ConfigurationRegistry.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this code except in compliance
- with the License. You may obtain a copy of the License
- at http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied. See the License for the specific language governing
- permissions and limitations under the License.
-
-*/
-package org.onap.dcae.cdf.util.config;
-
-import java.util.logging.*;
-import java.lang.ref.*;
-
-/**
- * Class to register and notify other objects when needed.
- * Those other objects must implement Configurable.
- */
-
-public class ConfigurationRegistry {
- public ConfigurationRegistry() { }
-
- /**
- * The set of registered configurables
- */
- private WeakReference<Configurable>[] configurables = new WeakReference[0];
-
- /**
- * Request callback whenever the configuration data changes
- */
- public synchronized void registerConfigurable(Configurable element) {
- // System.out.println("adding " + element.getClass().getName() + ", length=" + Integer.toString(configurables.length));
- for (int i = 0; i < configurables.length; i++) {
- if (configurables[i].get() == element) {
- return;
- }
- }
- WeakReference<Configurable>[] nconfigurables = new WeakReference[configurables.length + 1];
- System.arraycopy(configurables, 0, nconfigurables, 0, configurables.length);
- nconfigurables[configurables.length] = new WeakReference<Configurable>(element);
- configurables = nconfigurables;
- element.reConfigure();
- }
-
- /**
- * Cancel request for callbacks when configuration changes
- */
- public synchronized void deRegisterConfigurable(Configurable element) {
- // System.out.println("removing " + element.getClass().getName() + ", length=" + Integer.toString(configurables.length));
- for (int i = 0; i < configurables.length; i++) {
- if (configurables[i].get() == element) {
- WeakReference<Configurable>[] nconfigurables = new WeakReference[configurables.length - 1];
- if (i > 0) {
- System.arraycopy(configurables, 0, nconfigurables, 0, i);
- }
- if (i < nconfigurables.length) {
- System.arraycopy(configurables, i + 1, nconfigurables, i, nconfigurables.length - i);
- }
- configurables = nconfigurables;
- return;
- }
- }
- }
-
- /**
- * Notify all of the Configurables that they need to reConfigure.
- */
- public void reConfigureAll() {
- reConfigureAll(Logger.getLogger(ConfigurationRegistry.class.getName()));
- }
-
- /**
- * Notify all of the Configurables that they need to reConfigure.
- */
- public void reConfigureAll(Logger logger) {
- // System.out.println("reConfigureAll(), length=" + Integer.toString(configurables.length));
- for (int i = 0; i < configurables.length; i++) {
- try {
- // System.out.println("reConfigureAll(), i=" + Integer.toString(i));
- WeakReference<Configurable> wc = configurables[i];
- Configurable c = (wc != null) ? wc.get() : null;
- if (c != null)
- c.reConfigure();
- } catch (Exception e) {
- WeakReference<Configurable> wc = configurables[i];
- Configurable c = (wc != null) ? wc.get() : null;
- logger.log(Level.SEVERE, "DAIS0048 Unrecoverable configuration error CNFG0005: Problem while invoking reConfigure for: " +
- ((wc == null) ? "null" : (c == null) ? "null/null" : c.getClass().getName()) + ": " +
- e.getMessage(), e);
- }
- }
- }
-
- /**
- * Return the number of configurables that are registered.
- */
- public int getCount() {
- return configurables.length;
- }
-}