From 4ca4e0d5b321d3f4f321b49df02498d66b547d11 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Wed, 6 Sep 2017 12:03:51 -0400 Subject: 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 --- filters/provider/pom.xml | 1 - .../org/onap/ccsdk/sli/core/filters/Activator.java | 63 ---------------------- .../ccsdk/sli/core/filters/FiltersService.java | 4 ++ .../ccsdk/sli/core/filters/FiltersServiceImpl.java | 33 ++++++++++++ .../opendaylight/blueprint/filters-blueprint.xml | 9 ++++ 5 files changed, 46 insertions(+), 64 deletions(-) delete mode 100644 filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/Activator.java create mode 100644 filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersService.java create mode 100644 filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java create mode 100644 filters/provider/src/main/resources/org/opendaylight/blueprint/filters-blueprint.xml 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 @@ org.onap.ccsdk.sli.core.filters - org.onap.ccsdk.sli.core.filters.Activator org.onap.ccsdk.sli.core.filters org.onap.ccsdk.sli.core.filters javax.servlet.*,java.io.*,org.osgi.framework.*,org.slf4j.*,org.apache.commons.codec.binary.* 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/Activator.java deleted file mode 100644 index 6cac336a..00000000 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/Activator.java +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : CCSDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -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 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; - } - } - -} 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/FiltersServiceImpl.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java new file mode 100644 index 00000000..12370ca9 --- /dev/null +++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/FiltersServiceImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : CCSDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.core.filters; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FiltersServiceImpl implements FiltersService { + private static final Logger LOG = LoggerFactory.getLogger(FiltersServiceImpl.class); + + 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 @@ + + + + + + + -- cgit 1.2.3-korg