Fix service registration for SDNC
authorRyan Goulding <ryandgoulding@gmail.com>
Thu, 17 Aug 2017 20:15:39 +0000 (16:15 -0400)
committerRyan Goulding <ryandgoulding@gmail.com>
Wed, 6 Sep 2017 13:05:17 +0000 (09:05 -0400)
commitaf22e3dbddd5b372e815970ff43cc73e29135218
treeb437d5a2853cab8d0682256e518b9c204cf1b7db
parentb6ad62d01b1045ff03c03aa05ee1beeaabc633c7
Fix service registration for SDNC

Addresses the inherit race conditions associated with the
BundleActivator abstraction.  From lessons learned in OpenDaylight
project, dependency injection and service injection via Aries Blueprint
is faster, more deterministic, and has better error messaging than
using BundleActivator(s).

This change addresses several aspects:
1) DBLIBResourceActivator is changed to DBLIBResourceProvider.
   This was done in order to imply that this is no longer an
   Activator or subclass of an Activator.  The class is a POJO.
2) DBLIBResourceProvider is split from a single monolithic method
   into several more manageable and better documented methods.
3) Documentation surrounding the resolution of the DB properties
   is added so that a developer can more easily identify the
   strategy (priority) used for resolving properties.
4) dblib-blueprint.xml is added.  This is used to register the
   configuration bean (DBLIBResourceProvider), and pass it as
   an argument to the actual Service (DBLIBResourceManager).
5) Tests are added to test the functionality and resolution of
   the properties file loading.

Issue-Id: SDNC-54
Change-Id: Ie9d5fb423ae7a67e9aec026c78321537399cc308
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
15 files changed:
dblib/provider/pom.xml
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBLIBResourceActivator.java [deleted file]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBLIBResourceProvider.java [new file with mode: 0644]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibDefaultFileResolver.java [new file with mode: 0644]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibEnvVarFileResolver.java [new file with mode: 0644]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibJREFileResolver.java [new file with mode: 0644]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibKarafRootFileResolver.java [new file with mode: 0644]
dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibPropertiesFileResolver.java [new file with mode: 0644]
dblib/provider/src/main/resources/org/opendaylight/blueprint/dblib-blueprint.xml [new file with mode: 0644]
dblib/provider/src/test/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibDefaultFileResolverTest.java [new file with mode: 0644]
dblib/provider/src/test/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibEnvVarFileResolverTest.java [new file with mode: 0644]
dblib/provider/src/test/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibJREFileResolverTest.java [new file with mode: 0644]
dblib/provider/src/test/org/onap/ccsdk/sli/core/dblib/propertiesfileresolver/DblibKarafRootFileResolverTest.java [new file with mode: 0644]
sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java