diff options
author | 2017-04-04 10:09:50 +0000 | |
---|---|---|
committer | 2017-04-04 10:10:42 +0000 | |
commit | dcafbd7d9285aa7df3f5010642f1c1614e1147d0 (patch) | |
tree | bc635826a9ca3d77b082eb7d75dee27778d07642 /dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java | |
parent | b84d17f0f22c196dc05e719a74ecbaabb0387c3f (diff) |
[SDNC-5] summary
Updated dblib code from 17.07 branch
Change-Id: Ifa3ef1edbaa346bb4da388bdd9abe1dbdb165516
Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
Diffstat (limited to 'dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java')
-rw-r--r-- | dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java b/dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java index 85cf834..ea4c52c 100644 --- a/dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java +++ b/dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java @@ -26,6 +26,7 @@ import java.util.Properties; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -104,6 +105,23 @@ public class DBLIBResourceActivator implements BundleActivator { LOG.info("entering DBLIBResourceActivator.stop"); if (registration != null) { + try { + ServiceReference sref = ctx.getServiceReference(DbLibService.class.getName()); + + if (sref == null) { + LOG.warn("Could not find service reference for DBLIB service (" + DbLibService.class.getName() + ")"); + } else { + DBResourceManager dblibSvc = (DBResourceManager) ctx.getService(sref); + if (dblibSvc == null) { + LOG.warn("Could not find service reference for DBLIB service (" + DbLibService.class.getName() + ")"); + } else { + dblibSvc.cleanUp(); + } + } + } catch(Throwable exc) { + LOG.warn("Cleanup", exc); + } + registration.unregister(); registration = null; LOG.debug("Deregistering DBResourceManager service"); |