diff options
author | Gathman, Jonathan (jg1555) <jg1555@us.att.com> | 2019-07-17 16:07:20 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2019-07-22 13:45:06 -0500 |
commit | 58c2a7132f861e269ed707eb585657b0c9ead9f5 (patch) | |
tree | 582693f6852e1d1723924561275f0ec9922ae047 /cadi/core/src | |
parent | 5b77b6489dfb644a901e2640615a32d78f533351 (diff) |
Change API Version to 2.1.15
Issue-ID: AAF-902
Change-Id: I25ea4791fcbe45612197d7206b4af1ae23b6c489
Signed-off-by: Gathman, Jonathan (jg1555) <jg1555@us.att.com>
Diffstat (limited to 'cadi/core/src')
-rw-r--r-- | cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java | 7 | ||||
-rw-r--r-- | cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java index 994e3250..26aa98cb 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java @@ -21,12 +21,14 @@ package org.onap.aaf.cadi; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.PrintWriter; +import java.io.StringBufferInputStream; import java.io.StringWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -303,6 +305,11 @@ public class PropAccess implements Access { if (o!=null) { if(o.getClass().isArray()) { first = write(first,sb,(Object[])o); + } else if(o instanceof Throwable) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + ((Throwable)o).printStackTrace(ps); + sb.append(baos.toString()); } else { s=o.toString(); if (first) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index 48f5e2d1..b53b54da 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -976,6 +976,7 @@ public class Config { public static<T> void add(Access access, final String tag, List<Priori<T>> list) { String plugins = access.getProperty(tag, null); if(plugins!=null) { + access.log(Level.INIT, "Adding TAF Plugins: ", plugins); for(String tafs : Split.splitTrim(';', plugins)) { String[] pluginArray = Split.splitTrim(',', tafs); String clssn = null; @@ -1004,7 +1005,12 @@ public class Config { try { list.add(new Priori<T>(cnst.newInstance(access),priority)); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - access.printf(Level.ERROR, "%s cannot be constructed with Access.\n",clssn); + String hostname = access.getProperty(Config.HOSTNAME,null); + if(hostname==null) { + access.printf(Level.ERROR, "%s cannot be constructed on this machine. Set valid 'hostname' in your properties\n",clssn); + } else { + access.printf(Level.ERROR, "%s cannot be constructed on %s with Access.\n",clssn, hostname); + } } } catch (NoSuchMethodException | SecurityException e) { access.printf(Level.ERROR, "%s needs a Constructor taking Access as sole param.\n",clssn); |