aboutsummaryrefslogtreecommitdiffstats
path: root/policy-utils/src/main
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-06-22 17:17:28 -0500
committerJorge Hernandez <jh1730@att.com>2017-06-22 17:17:28 -0500
commit8f61e18ef0457745719f05bd5c186992a7155416 (patch)
tree884f4653f957a88a65ea981727dfe26494fb7c55 /policy-utils/src/main
parent3cc1a85a832771cb70ed9cbaab9031bc4a114308 (diff)
[POLICY-30] remove problematic layers
add configurability through telemetry API Change-Id: I77ebde12a417d421b98646c32dc74824f4494c2e Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-utils/src/main')
-rw-r--r--policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java8
-rw-r--r--policy-utils/src/main/java/org/openecomp/policy/drools/utils/PropertyUtil.java18
-rw-r--r--policy-utils/src/main/java/org/openecomp/policy/drools/utils/ReflectionUtil.java22
3 files changed, 16 insertions, 32 deletions
diff --git a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
index c5f9a343..72bf7b8b 100644
--- a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
+++ b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
@@ -27,12 +27,18 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ServiceLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* This class is a template for building a sorted list of service instances,
* which are discovered and created using 'ServiceLoader'.
*/
public class OrderedServiceImpl<T extends OrderedService>
{
+ // logger
+ private static Logger logger = LoggerFactory.getLogger(OrderedServiceImpl.class);
+
// sorted list of instances implementing the service
private List<T> implementers = null;
@@ -113,7 +119,7 @@ public class OrderedServiceImpl<T extends OrderedService>
// create an unmodifiable version of this list
implementers = Collections.unmodifiableList(tmp);
- System.out.println("***** OrderedServiceImpl implementers:\n" + implementers);
+ logger.info("***** OrderedServiceImpl implementers:\n {}", implementers);
return(implementers);
}
diff --git a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/PropertyUtil.java b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/PropertyUtil.java
index 34ddcc1c..1e8dc267 100644
--- a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/PropertyUtil.java
+++ b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/PropertyUtil.java
@@ -382,22 +382,4 @@ public class PropertyUtil
stopListening(new File(fileName), listener);
}
- /* ============================================================ */
-
- // TEMPORARY - used to test callback interface
- static public class Test implements Listener
- {
- String name;
-
- public Test(String name)
- {
- this.name = name;
- }
-
- public void propertiesChanged(Properties properties, Set<String> changedKeys)
- {
- System.out.println("Test(" + name + ")\nproperties = " + properties
- + "\nchangedKeys = " + changedKeys);
- }
- }
}
diff --git a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/ReflectionUtil.java b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/ReflectionUtil.java
index 1ab68282..0d82e847 100644
--- a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/ReflectionUtil.java
+++ b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/ReflectionUtil.java
@@ -23,43 +23,41 @@
*/
package org.openecomp.policy.drools.utils;
-import org.openecomp.policy.common.logging.eelf.PolicyLogger;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Reflection utilities
*
*/
public class ReflectionUtil {
+ protected final static Logger logger = LoggerFactory.getLogger(ReflectionUtil.class);
+
/**
* returns (if exists) a class fetched from a given classloader
*
* @param classLoader the class loader
- * @param classname the class name
+ * @param className the class name
* @return the actual class
* @throws IllegalArgumentException if an invalid parameter has been passed in
*/
public static Class<?> fetchClass(ClassLoader classLoader,
- String classname)
+ String className)
throws IllegalArgumentException {
-
- PolicyLogger.info("FETCH-CLASS: " + classname + " FROM " + classLoader);
-
if (classLoader == null)
throw new IllegalArgumentException("A class loader must be provided");
- if (classname == null)
+ if (className == null)
throw new IllegalArgumentException("A class name to be fetched in class loader " +
classLoader + " must be provided");
try {
- Class<?> aClass = Class.forName(classname,
+ Class<?> aClass = Class.forName(className,
true,
classLoader);
return aClass;
} catch (Exception e) {
- e.printStackTrace();
- PolicyLogger.error("FETCH-CLASS: " + classname + " IN " + classLoader + " does NOT exist");
+ logger.error("FETCHED-CLASS {} IN {} does NOT EXIST", className, classLoader);
}
return null;
@@ -84,8 +82,6 @@ public class ReflectionUtil {
* @return
*/
public static boolean isSubclass(Class<?> parent, Class<?> presumedSubclass) {
- PolicyLogger.debug("IS-SUBCLASS: superclass: " + parent.getCanonicalName() +
- " subclass: " + presumedSubclass.getCanonicalName());
return (parent.isAssignableFrom(presumedSubclass));
}