From: Florin Coras Date: Mon, 18 May 2015 23:22:32 +0000 (-0700) Subject: Removing AD-SAL dependencies X-Git-Tag: release/beryllium~169 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=64b1dd724a0ab747c60bfb89108c80dbdddffbea;p=lispflowmapping.git Removing AD-SAL dependencies Change-Id: I8df9f0076d9ed2882f05669c53e6b0ec72b98894 Signed-off-by: Florin Coras --- diff --git a/commons/parent/pom.xml b/commons/parent/pom.xml index 3cb364fbb..83442fdd6 100644 --- a/commons/parent/pom.xml +++ b/commons/parent/pom.xml @@ -110,13 +110,6 @@ 0.7.0-SNAPSHOT --> - - org.opendaylight.controller - features-adsal - ${sal.version} - features - xml - org.opendaylight.controller features-mdsal diff --git a/features/pom.xml b/features/pom.xml index 9dfb14b5b..33279f2ed 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -20,6 +20,7 @@ 3.1.1 + 1.6.0-SNAPSHOT etc/opendaylight/karaf features.xml 1.3.0-SNAPSHOT @@ -40,7 +41,8 @@ org.opendaylight.controller - features-adsal + features-base + ${commons.opendaylight.version} features xml diff --git a/features/src/main/resources/features.xml b/features/src/main/resources/features.xml index 46d2e1890..eef6465e0 100644 --- a/features/src/main/resources/features.xml +++ b/features/src/main/resources/features.xml @@ -13,7 +13,9 @@ mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features - mvn:org.opendaylight.controller/features-adsal/${sal.version}/xml/features + + + mvn:org.opendaylight.controller/features-base/${commons.opendaylight.version}/xml/features mvn:org.opendaylight.neutron/features-neutron/${neutron.version}/xml/features mvn:org.opendaylight.controller/features-nsf/${nsf.version}/xml/features mvn:org.opendaylight.controller/features-netconf-connector/${mdsal.version}/xml/features @@ -27,9 +29,11 @@ + + odl-base-felix-dm odl-mdsal-broker odl-mdsal-apidocs - odl-adsal-core + odl-yangtools-binding odl-yangtools-models diff --git a/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/Activator.java b/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/Activator.java index 0e2ddd3fb..6336da7ab 100644 --- a/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/Activator.java +++ b/mappingservice/clusterdao/src/main/java/org/opendaylight/lispflowmapping/clusterdao/Activator.java @@ -11,10 +11,11 @@ package org.opendaylight.lispflowmapping.clusterdao; import java.util.Dictionary; import java.util.Hashtable; -import org.apache.felix.dm.Component; +import org.apache.felix.dm.DependencyActivatorBase; +import org.apache.felix.dm.DependencyManager; import org.opendaylight.controller.clustering.services.IClusterContainerServices; -import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase; import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO; +import org.osgi.framework.BundleContext; /** * Main application activator class for registering the dependencies and @@ -22,98 +23,22 @@ import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO; * */ -public class Activator extends ComponentActivatorAbstractBase { +public class Activator extends DependencyActivatorBase { - /** - * Function called when the activator starts just after some initializations - * are done by the ComponentActivatorAbstractBase. - * - */ @Override - public void init() { - } - - /** - * Function called when the activator stops just before the cleanup done by - * ComponentActivatorAbstractBase - * - */ - @Override - public void destroy() { - } + public void init(BundleContext context, DependencyManager manager) throws Exception { + Dictionary props = new Hashtable(); + props.put("name", "clusterosgiservice"); + manager.add(createComponent().setInterface(new String[] { ILispDAO.class.getName() }, props) + .setImplementation(ClusterDAOService.class) + .add(createServiceDependency().setService(IClusterContainerServices.class) + .setCallbacks("setClusterContainerService", "unsetClusterContainerService").setRequired(true))); - /** - * Function that is used to communicate to dependency manager the list of - * known implementations for services inside a container - * - * - * @return An array containing all the CLASS objects that will be - * instantiated in order to get an fully working implementation - * Object - */ - @Override - public Object[] getImplementations() { - Object[] res = { ClusterDAOService.class }; - return res; - } - - /** - * Function that is called when configuration of the dependencies is - * required. - * - * @param c - * dependency manager Component object, used for configuring the - * dependencies exported and imported - * @param imp - * Implementation class that is being configured, needed as long - * as the same routine can configure multiple implementations - * @param containerName - * The containerName being configured, this allow also optional - * per-container different behavior if needed, usually should not - * be the case though. - */ - @Override - public void configureInstance(Component c, Object imp, String containerName) { - if (imp.equals(ClusterDAOService.class)) { - // export the service - Dictionary props = new Hashtable(); - props.put("name", "clusterosgiservice"); - c.setInterface(new String[] { ILispDAO.class.getName() }, props); - c.add(createContainerServiceDependency(containerName).setService(IClusterContainerServices.class) - .setCallbacks("setClusterContainerService", "unsetClusterContainerService").setRequired(true)); - } - } - - /** - * Method which tells how many Global implementations are supported by the - * bundle. This way we can tune the number of components created. This - * components will be created ONLY at the time of bundle startup and will be - * destroyed only at time of bundle destruction, this is the major - * difference with the implementation retrieved via getImplementations where - * all of them are assumed to be in a container ! - * - * - * @return The list of implementations the bundle will support, in Global - * version - */ - @Override - protected Object[] getGlobalImplementations() { - return null; } - /** - * Configure the dependency for a given instance Global - * - * @param c - * Component assigned for this instance, this will be what will - * be used for configuration - * @param imp - * implementation to be configured - * @param containerName - * container on which the configuration happens - */ @Override - protected void configureGlobalInstance(Component c, Object imp) { + public void destroy(BundleContext context, DependencyManager manager) throws Exception { + // TODO Auto-generated method stub } } diff --git a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/Activator.java b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/Activator.java index ec64d94f5..27889417c 100644 --- a/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/Activator.java +++ b/mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/Activator.java @@ -11,12 +11,12 @@ package org.opendaylight.lispflowmapping.implementation; import java.util.Dictionary; import java.util.Hashtable; -import org.apache.felix.dm.Component; +import org.apache.felix.dm.DependencyActivatorBase; +import org.apache.felix.dm.DependencyManager; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase; -import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO; import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping; import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMappingShell; +import org.osgi.framework.BundleContext; /** * Main application activator class for registering the dependencies and @@ -24,96 +24,22 @@ import org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMappingShell; * */ -public class Activator extends ComponentActivatorAbstractBase { +public class Activator extends DependencyActivatorBase { - /** - * Function called when the activator starts just after some initializations - * are done by the ComponentActivatorAbstractBase. - * - */ @Override - public void init() { - } - - /** - * Function called when the activator stops just before the cleanup done by - * ComponentActivatorAbstractBase - * - */ - @Override - public void destroy() { - } + public void init(BundleContext context, DependencyManager manager) throws Exception { + Dictionary props = new Hashtable(); + props.put("name", "mappingservice"); + manager.add(createComponent().setInterface(new String[] { IFlowMapping.class.getName(), IFlowMappingShell.class.getName() }, props) + .setImplementation(LispMappingService.class) + .add(createServiceDependency().setService(BindingAwareBroker.class).setRequired(true) + .setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker"))); - /** - * Function that is used to communicate to dependency manager the list of - * known implementations for services inside a container - * - * - * @return An array containing all the CLASS objects that will be - * instantiated in order to get an fully working implementation - * Object - */ - @Override - public Object[] getImplementations() { - Object[] res = { LispMappingService.class }; - return res; - } - - /** - * Function that is called when configuration of the dependencies is - * required. - * - * @param c - * dependency manager Component object, used for configuring the - * dependencies exported and imported - * @param imp - * Implementation class that is being configured, needed as long - * as the same routine can configure multiple implementations - * @param containerName - * The containerName being configured, this allow also optional - * per-container different behavior if needed, usually should not - * be the case though. - */ - @Override - public void configureInstance(Component c, Object imp, String containerName) { - if (imp.equals(LispMappingService.class)) { - // export the service - Dictionary props = new Hashtable(); - props.put("name", "mappingservice"); - c.setInterface(new String[] { IFlowMapping.class.getName(), IFlowMappingShell.class.getName() }, props); - c.add(createServiceDependency().setService(BindingAwareBroker.class).setRequired(true) - .setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker")); - } - } - - /** - * Method which tells how many Global implementations are supported by the - * bundle. This way we can tune the number of components created. This - * components will be created ONLY at the time of bundle startup and will be - * destroyed only at time of bundle destruction, this is the major - * difference with the implementation retrieved via getImplementations where - * all of them are assumed to be in a container ! - * - * - * @return The list of implementations the bundle will support, in Global - * version - */ - @Override - protected Object[] getGlobalImplementations() { - return null; } - /** - * Configure the dependency for a given instance Global - * - * @param c - * Component assigned for this instance, this will be what will - * be used for configuration - * @param imp - * implementation to be configured - */ @Override - protected void configureGlobalInstance(Component c, Object imp) { + public void destroy(BundleContext context, DependencyManager manager) throws Exception { + // TODO Auto-generated method stub } }