summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Goulding <ryandgoulding@gmail.com>2017-09-06 12:03:51 -0400
committerRyan Goulding <ryandgoulding@gmail.com>2017-09-06 12:04:45 -0400
commit4ca4e0d5b321d3f4f321b49df02498d66b547d11 (patch)
treef148f54336b2ecadaa5200d836eb1c4238c0540a
parentb6ad62d01b1045ff03c03aa05ee1beeaabc633c7 (diff)
Fix SDNC service registration
Convert the BundleActivator to a POJO provider, and do the service registration through blueprint instead. Issue-Id: SDNC-54 Change-Id: Ia5618ef443967803b31da1ac9e020d1092c3ab8d Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
-rwxr-xr-xfilters/provider/pom.xml1
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersService.java4
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java (renamed from filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/Activator.java)38
-rw-r--r--filters/provider/src/main/resources/org/opendaylight/blueprint/filters-blueprint.xml9
4 files changed, 17 insertions, 35 deletions
diff --git a/filters/provider/pom.xml b/filters/provider/pom.xml
index 9f59d346..240966e8 100755
--- a/filters/provider/pom.xml
+++ b/filters/provider/pom.xml
@@ -73,7 +73,6 @@
<configuration>
<instructions>
<Bundle-SymbolicName>org.onap.ccsdk.sli.core.filters</Bundle-SymbolicName>
- <Bundle-Activator>org.onap.ccsdk.sli.core.filters.Activator</Bundle-Activator>
<Export-Package>org.onap.ccsdk.sli.core.filters</Export-Package>
<DynamicImport-Package>org.onap.ccsdk.sli.core.filters</DynamicImport-Package>
<Import-Package>javax.servlet.*,java.io.*,org.osgi.framework.*,org.slf4j.*,org.apache.commons.codec.binary.*</Import-Package>
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersService.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersService.java
new file mode 100644
index 00000000..9587e8d9
--- /dev/null
+++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersService.java
@@ -0,0 +1,4 @@
+package org.onap.ccsdk.sli.core.filters;
+
+public interface FiltersService {
+}
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/Activator.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java
index 6cac336a..12370ca9 100644
--- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/Activator.java
+++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java
@@ -21,43 +21,13 @@
package org.onap.ccsdk.sli.core.filters;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+public class FiltersServiceImpl implements FiltersService {
+ private static final Logger LOG = LoggerFactory.getLogger(FiltersServiceImpl.class);
-public class Activator implements BundleActivator {
-
- private ServiceRegistration registration = null;
-
- private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
-
- @Override
- public void start(BundleContext ctx) throws Exception {
-
-
-
- Object impl = new String();
- String regName = impl.getClass().getName();
-
- if (registration == null)
- {
- LOG.debug("Registering Filters service "+regName);
- registration = ctx.registerService(regName, impl, null);
- }
-
- }
-
- @Override
- public void stop(BundleContext ctx) throws Exception {
-
- if (registration != null)
- {
- registration.unregister();
- registration = null;
- }
+ public FiltersServiceImpl() {
+ LOG.debug("Registering {}", FiltersServiceImpl.class.getName());
}
-
}
diff --git a/filters/provider/src/main/resources/org/opendaylight/blueprint/filters-blueprint.xml b/filters/provider/src/main/resources/org/opendaylight/blueprint/filters-blueprint.xml
new file mode 100644
index 00000000..3bf8423e
--- /dev/null
+++ b/filters/provider/src/main/resources/org/opendaylight/blueprint/filters-blueprint.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
+
+ <bean id="filters" class="org.onap.ccsdk.sli.core.filters.FiltersServiceImpl" />
+ <service ref="filters" interface="org.onap.ccsdk.sli.core.filters.FiltersService" />
+
+</blueprint>