aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/services/Registry.java
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17Use lombok in policy-common utilsJim Hahn1-8/+4
Issue-ID: POLICY-3394 Change-Id: I42a18c115c3ca7110f37fc0ae8aeea3f2bbffb37 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-12Apply simple sonar fixesJim Hahn1-1/+1
Note: A number of these were identified, by SonarLint, in the Test classes, which are not typically scanned by Sonar. Removed unnecessary imports. Removed unneeded "throws Xxx". Replaced lambda with method references. Replaced duplicate strings with constants. Replaced try-fail-catch with assert-j methods to eliminate sonar complaints about duplicate failure messages. Added missing @Override annotations. Use map.computeIfAbsent() where appropriate. Also fixed some minor checkstyle issues. Removed unneeded "volatile" declarations. Replaced some if-else constructs with "?:" construct, per sonar. Replaced Object.wait() with CountDownLatch.await(); according to sonar (and javadocs), Object.wait() can return due to "spurious wakeups". Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse. Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-26Add get() without clazzJim Hahn1-0/+17
Added Registry.get() that does not need a class argument. Change-Id: I3e8b0e3cc14eda914e0b1b201e6ddf67a9e3462e Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-21Add simple Registry class to manage singletonsJim Hahn1-0/+151
Typically, singleton classes have lots of static methods, or use a getInstance() method to get the singleton. This provides an alternative mechanism, similar to the JDNI and the common-paramater property registry, where singletons can be registered. Clean up registry after junit test. Modified a few comments. (I prefer 90 characters for comments.) Added a method to register or replace an existing key without throwing an exception. Change-Id: I3b62719013d3b5f71adb5e9299d3c1257fb55c80 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>