<version>0.7.0-SNAPSHOT</version>
</dependency>
-->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>features-adsal</artifactId>
- <version>${sal.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-mdsal</artifactId>
<maven>3.1.1</maven>
</prerequisites>
<properties>
+ <commons.opendaylight.version>1.6.0-SNAPSHOT</commons.opendaylight.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
<features.file>features.xml</features.file>
<mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
<dependencies>
<dependency>
<groupId>org.opendaylight.controller</groupId>
- <artifactId>features-adsal</artifactId>
+ <artifactId>features-base</artifactId>
+ <version>${commons.opendaylight.version}</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
<repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
<repository>mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.controller/features-adsal/${sal.version}/xml/features</repository>
+ <!-- <repository>mvn:org.opendaylight.controller/features-adsal/${sal.version}/xml/features</repository> -->
+ <!-- TODO features-base should be removed when we get rid of Activators, hopefully soon -->
+ <repository>mvn:org.opendaylight.controller/features-base/${commons.opendaylight.version}/xml/features</repository>
<repository>mvn:org.opendaylight.neutron/features-neutron/${neutron.version}/xml/features</repository>
<repository>mvn:org.opendaylight.controller/features-nsf/${nsf.version}/xml/features</repository>
<repository>mvn:org.opendaylight.controller/features-netconf-connector/${mdsal.version}/xml/features</repository>
</feature>
<feature name="odl-lispflowmapping-mappingservice" description="OpenDaylight :: LISP Flow Mapping :: Mapping Service" version='${lispflowmapping.version}'>
+ <!-- TODO felix-dm should be removed when we get rid of Activators, hopefully soon -->
+ <feature>odl-base-felix-dm</feature>
<feature version="${mdsal.version}">odl-mdsal-broker</feature>
<feature version="${mdsal.version}">odl-mdsal-apidocs</feature>
- <feature version="${sal.version}">odl-adsal-core</feature>
+ <!-- <feature version="${sal.version}">odl-adsal-core</feature> -->
<!-- <feature version="${clustering.services.version}">odl-adsal-clustering</feature> -->
<feature version='${yangtools.version}'>odl-yangtools-binding</feature>
<feature version='${yangtools.version}'>odl-yangtools-models</feature>
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
*
*/
-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<String, String> props = new Hashtable<String, String>();
+ 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<String, String> props = new Hashtable<String, String>();
- 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
}
}
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
*
*/
-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<String, String> props = new Hashtable<String, String>();
+ 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<String, String> props = new Hashtable<String, String>();
- 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
}
}