aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
AgeCommit message (Collapse)AuthorFilesLines
2023-09-21Java 17 Upgradeadheli.tavares1-1/+1
Issue-ID: POLICY-4668 Change-Id: If4e79224de61d66d7514f3abbd7b8bee1c3d5681 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-08-23Prevent deadlock in ServiceManagerJim Hahn1-9/+10
Modified the ServiceManager code so that isAlive() can be invoked without requiring synchronization, thus eliminating one potential area of deadlock. Issue-ID: POLICY-3531 Change-Id: I27d060c3a7cfad8dab20a197d1e42c4ee607a1e2 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-17Use lombok in policy-common utilsJim Hahn1-11/+5
Issue-ID: POLICY-3394 Change-Id: I42a18c115c3ca7110f37fc0ae8aeea3f2bbffb37 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-06Address sonar issues in commonJim Hahn1-2/+8
Addressed the following sonar issues: - missing assertion in junit test case - disable sonars about setAccessible() as it's required for jackson emulation - sleep in junit - don't use wild-cards (e.g., "*") with java.util Pattern - use re2j instead of java.util Pattern - use String methods (e.g., startsWith()) - duplicate method bodies - duplicate code in Coder classes - string concatenation in logger calls - UTF-8 encoding - return primitive instead of boxed primitive - add assertion to tests - renamed support methods from doTestXxx to verifyXxx - cognitive complexity - use AtomicRef instead of volatile - use specific Functionals (e.g., IntConsumer) - function always returns the same value - serializable vs transient Issue-ID: POLICY-2305 Change-Id: I08eb7aa495a80bdc1d26827ba17a7946c83b9828 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-29Fix sonar issue with double compare4.0.0-ONAP1.4.0Jim Hahn1-2/+2
The gson code to convert Double to Long/Integer use a direct comparison of the original double with a long. However, sonar does not like that so changed the code to use the Double.compare() method instead. Also fixed sonar issue with diamond operator. Addressed some sonar issues in ServiceManager. Addressed some sonar issues in Version. Change-Id: I0959603918d251db671e87e12c295c6ec911f427 Issue-ID: POLICY-1707 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-16Make ServiceManager implement StartableJim Hahn1-27/+59
Also added a "name" to the manager, for logger purposes. Change-Id: Ide57cdec1fafc36c43b7f7584c0baad6261e8412 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-11Add ServiceManager classJim Hahn1-0/+190
Added ServiceManager class to start a list of services, in order, and stop them in reverse order. Also addressed minor checkstyle issue in TopicSinkClient. Enabled logging from tests. Updated some comments. Updated license date. Added state checks and support for multi-threading. Change-Id: Ie7f053d9884766fe199895691a57eb5a51b1d155 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>