aboutsummaryrefslogtreecommitdiffstats
path: root/dblib/provider/src/main/java/org/openecomp/sdnc/sli/resource/dblib/DBLIBResourceActivator.java
diff options
context:
space:
mode:
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.java18
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");