aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/services
AgeCommit message (Collapse)AuthorFilesLines
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>
2019-03-20Add wrapper for ServiceManagerJim Hahn1-0/+99
This makes it easier for a class to implement a Startable interface, using a ServiceManager internally, while preventing other classes from adding services to the manager (as would be the case if the class were simply subclassed from the ServiceManager). Changed the field name to be more descriptive. Fixed a typo in a comment. Change-Id: I1bed6291114d21c20d2324cbda81518bf9183139 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-18Merge "Add Network Logging Feature"Liam Fallon2-0/+182
2019-03-16Make ServiceManager implement StartableJim Hahn2-28/+60
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-13Add Network Logging FeatureDaniel Cruz2-0/+182
This is part 1 of introducing the mdc filter feature. Network logging has to have interception points in order to pre/post process messages coming in from a network endpoint. The OrderedService interface and OrderedServiceImpl of the drools-pdp project have now been migrated to common but is also left in drools-pdp to mitigate disruption to existing features. However for features that need to use common's OrderedServiceImpl and drools-pdp version of OrderedServiceImpl there will be a conflict with getSequenceNumber(). So a migration of the other features is suggested. Network logging is moved to its own util class so that feature hooks can be invoked any time an event is being logged by a network logger. This util class will also be accessible to drools-applications in the case where drools-applications would like to invoke network logging features for REST events. Change-Id: I83d7c46e5abb351486f841c3be4d9009f7992476 Issue-ID: POLICY-1499 Signed-off-by: Daniel Cruz <dc443y@att.com>
2019-03-11Add ServiceManager classJim Hahn2-0/+234
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>