<artifactId>sal-binding-api</artifactId>
<version>${mdsal.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-config</artifactId>
+ <version>${mdsal.version}</version>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-broker-impl</artifactId>
</executions>
</plugin>
</plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse
- m2e settings only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.opendaylight.yangtools
- </groupId>
- <artifactId>
- yang-maven-plugin
- </artifactId>
- <versionRange>
- [0.5,)
- </versionRange>
- <goals>
- <goal>
- generate-sources
- </goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
</build>
<dependencies>
<!-- Binding Aware -->
<module>sal-binding-api</module>
+ <module>sal-binding-config</module>
<module>sal-binding-broker</module>
<module>sal-binding-it</module>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
+ <!--This plugin's configuration is used to store Eclipse
+ m2e settings only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.opendaylight.yangtools
+ </groupId>
+ <artifactId>
+ yang-maven-plugin
+ </artifactId>
+ <versionRange>
+ [0.5,)
+ </versionRange>
+ <goals>
+ <goal>
+ generate-sources
+ </goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
public interface RpcRegistration<T extends RpcService> extends Registration<T> {
- /**
- *
- * @return instance for which registration does exists.
- */
- @Deprecated
- T getService();
+ Class<T> getServiceType();
}
public interface RoutedRpcRegistration<T extends RpcService> extends RpcRegistration<T>,
@Deprecated
void registerInstance(Class<? extends BaseIdentity> context, InstanceIdentifier<?> instance);
+ /**
+ * Unregister particular instance identifier to be processed by this
+ * RpcService
+ *
+ * Deprecated in favor of {@link RoutedRegistration#unregisterPath(Object, Object)}.
+ *
+ * @param context
+ * @param instance
+ */
@Deprecated
void unregisterInstance(Class<? extends BaseIdentity> context, InstanceIdentifier<?> instance);
}
<build>
<plugins>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>0.5.9-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>
+ org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ </codeGeneratorClass>
+ <outputBaseDir>${project.build.directory}/generated-sources/config</outputBaseDir>
+ <additionalConfiguration>
+ <namespaceToPackage1>
+ urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang
+ </namespaceToPackage1>
+ </additionalConfiguration>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-jmx-generator-plugin</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/config</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- <Bundle-Activator>org.opendaylight.controller.sal.binding.impl.BrokerActivator</Bundle-Activator>
<Private-Package>
+ org.opendaylight.controller.config.yang.md.sal.binding.impl,
+ org.opendaylight.controller.sal.binding.spi,
+ org.opendaylight.controller.sal.binding.spi.*,
org.opendaylight.controller.sal.binding.impl,
org.opendaylight.controller.sal.binding.impl.*,
org.opendaylight.controller.sal.binding.codegen.*,
<artifactId>maven-clean-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <configuration>
- <includes>org.opendaylight.controller.*</includes>
- </configuration>
- <executions>
- <execution>
- <id>pre-test</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>post-test</id>
- <phase>test</phase>
- <goals>
- <goal>report</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration>
+ <includes>org.opendaylight.controller.*</includes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>pre-test</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>post-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-config</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.yang.md.sal.binding.impl;
+
+import org.opendaylight.controller.sal.binding.impl.BindingAwareBrokerImpl;
+import org.osgi.framework.BundleContext;
+
+import com.google.common.base.Preconditions;
+
+/**
+*
+*/
+public final class BindingBrokerImplSingletonModule extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplSingletonModule
+{
+
+ private BundleContext bundleContext;
+
+ public BindingBrokerImplSingletonModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public BindingBrokerImplSingletonModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, BindingBrokerImplSingletonModule oldModule, java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ Preconditions.checkNotNull(getBundleContext());
+ }
+
+
+
+
+
+ public java.lang.AutoCloseable createInstance() {
+ BindingAwareBrokerImpl broker = new BindingAwareBrokerImpl(getBundleContext());
+ broker.start();
+ return broker;
+ }
+
+ public BundleContext getBundleContext() {
+ return bundleContext;
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.config.yang.md.sal.binding.impl;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.DependencyResolverFactory;
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.spi.Module;
+import org.osgi.framework.BundleContext;
+
+/**
+*
+*/
+public class BindingBrokerImplSingletonModuleFactory extends
+ org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplSingletonModuleFactory {
+
+ private static final String SINGLETON_NAME = "binding-broker-singleton";
+ public static BindingBrokerImplSingletonModule SINGLETON;
+ public static ModuleIdentifier SINGLETON_IDENTIFIER = new ModuleIdentifier(NAME, SINGLETON_NAME);
+
+ @Override
+ public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
+ throw new UnsupportedOperationException("Only default instance supported.");
+ }
+
+ @Override
+ public Module createModule(String instanceName, DependencyResolver dependencyResolver,
+ DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
+ throw new UnsupportedOperationException("Only default instance supported.");
+ }
+
+ @Override
+ public Set<BindingBrokerImplSingletonModule> getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
+ BundleContext bundleContext) {
+ if (SINGLETON == null) {
+
+ DependencyResolver dependencyResolver = dependencyResolverFactory
+ .createDependencyResolver(SINGLETON_IDENTIFIER);
+ SINGLETON = new BindingBrokerImplSingletonModule(SINGLETON_IDENTIFIER, dependencyResolver);
+ SINGLETON.setBundleContext(bundleContext);
+ }
+
+ return Collections.singleton(SINGLETON);
+ }
+
+}
import com.google.common.collect.HashMultimap
import static org.opendaylight.controller.sal.binding.impl.osgi.ClassLoaderUtils.*
import java.util.concurrent.Executors
+import java.util.Collections
+import org.opendaylight.yangtools.yang.binding.DataObject
-class BindingAwareBrokerImpl implements BindingAwareBroker {
+class BindingAwareBrokerImpl implements BindingAwareBroker, AutoCloseable {
private static val log = LoggerFactory.getLogger(BindingAwareBrokerImpl)
+
+ private InstanceIdentifier<? extends DataObject> root = InstanceIdentifier.builder().toInstance();
+
private val clsPool = ClassPool.getDefault()
private var RuntimeCodeGenerator generator;
@Property
private var DataBrokerImpl dataBroker
- private var ServiceRegistration<NotificationProviderService> notifyBrokerRegistration
-
@Property
var BundleContext brokerBundleContext
+
+ ServiceRegistration<NotificationProviderService> notifyProviderRegistration
+
+ ServiceRegistration<NotificationService> notifyConsumerRegistration
+
+ ServiceRegistration<DataProviderService> dataProviderRegistration
+
+ ServiceRegistration<DataBrokerService> dataConsumerRegistration
+
+ private HashMapDataStore store = new HashMapDataStore();
+
+ public new(BundleContext bundleContext) {
+ _brokerBundleContext = bundleContext;
+ }
def start() {
+ log.info("Starting MD-SAL: Binding Aware Broker");
initGenerator();
val executor = Executors.newCachedThreadPool;
// Initialization of notificationBroker
+ log.info("Starting MD-SAL: Binding Aware Notification Broker");
notifyBroker = new NotificationBrokerImpl(executor);
notifyBroker.invokerFactory = generator.invokerFactory;
+
+ log.info("Starting MD-SAL: Binding Aware Data Broker");
dataBroker = new DataBrokerImpl();
dataBroker.executor = executor;
+
val brokerProperties = newProperties();
- notifyBrokerRegistration = brokerBundleContext.registerService(NotificationProviderService, notifyBroker,
+
+
+ log.info("Starting MD-SAL: Binding Aware Data Broker");
+ notifyProviderRegistration = brokerBundleContext.registerService(NotificationProviderService, notifyBroker,
brokerProperties)
- brokerBundleContext.registerService(NotificationService, notifyBroker, brokerProperties)
- brokerBundleContext.registerService(DataProviderService, dataBroker, brokerProperties)
- brokerBundleContext.registerService(DataBrokerService, dataBroker, brokerProperties)
+ notifyConsumerRegistration = brokerBundleContext.registerService(NotificationService, notifyBroker, brokerProperties)
+ dataProviderRegistration = brokerBundleContext.registerService(DataProviderService, dataBroker, brokerProperties)
+ dataConsumerRegistration = brokerBundleContext.registerService(DataBrokerService, dataBroker, brokerProperties)
-
+ getDataBroker().registerDataReader(root, store);
+ getDataBroker().registerCommitHandler(root, store)
+
+ log.info("MD-SAL: Binding Aware Broker Started");
}
def initGenerator() {
val osgiReg = context.bundleContext.registerService(type, service, properties);
proxy.delegate = service;
- return new RpcServiceRegistrationImpl<T>(type, service, osgiReg);
- }
-
- def <T extends RpcService> RpcRegistration<T> registerMountedRpcImplementation(Class<T> type, T service,
- InstanceIdentifier<?> identifier, OsgiProviderContext context) {
- throw new UnsupportedOperationException("TODO: auto-generated method stub")
+ return new RpcServiceRegistrationImpl<T>(type, service, osgiReg,this);
}
def <T extends RpcService> RoutedRpcRegistration<T> registerRoutedRpcImplementation(Class<T> type, T service,
val routingTable = router.getRoutingTable(context)
val path = ctxMap.value
routingTable.removeRoute(path)
+ }
+ }
+
+ protected def <T extends RpcService> void unregisterRpcService(RpcServiceRegistrationImpl<T> registration) {
+ val type = registration.serviceType;
+
+ val proxy = managedProxies.get(type);
+ if(proxy.proxy.delegate === registration.instance) {
+ proxy.proxy.delegate = null;
}
}
getManagedDirectProxy(type);
}
+ def getRpcRouters() {
+ return Collections.unmodifiableMap(rpcRouters);
+ }
+
+ override close() {
+ dataConsumerRegistration.unregister()
+ dataProviderRegistration.unregister()
+ notifyConsumerRegistration.unregister()
+ notifyProviderRegistration.unregister()
+ }
+
}
class RoutedRpcRegistrationImpl<T extends RpcService> extends AbstractObjectRegistration<T> implements RoutedRpcRegistration<T> {
unregisterPath(context, instance);
}
- override getService() {
- return instance;
- }
-
override registerPath(Class<? extends BaseIdentity> context, InstanceIdentifier<? extends Object> path) {
checkClosed()
broker.registerPath(this, context, path);
checkClosed()
broker.unregisterPath(this, context, path);
}
+
+ override getServiceType() {
+ return router.serviceType;
+ }
private def checkClosed() {
if (closed)
}
}
+class RpcServiceRegistrationImpl<T extends RpcService> extends AbstractObjectRegistration<T> implements RpcRegistration<T> {
+
+ val ServiceRegistration<T> osgiRegistration;
+ private var BindingAwareBrokerImpl broker;
+
+ @Property
+ val Class<T> serviceType;
+
+ public new(Class<T> type, T service, ServiceRegistration<T> osgiReg,BindingAwareBrokerImpl broker) {
+ super(service);
+ this._serviceType = type;
+ this.osgiRegistration = osgiReg;
+ this.broker= broker;
+ }
+
+ override protected removeRegistration() {
+ broker.unregisterRpcService(this);
+ broker = null;
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.impl;
-
-import java.util.Hashtable;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-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 BrokerActivator implements BundleActivator {
-
- private static final Logger log = LoggerFactory.getLogger(BrokerActivator.class);
- private BindingAwareBrokerImpl baSal;
- private ServiceRegistration<BindingAwareBroker> baSalRegistration;
- private HashMapDataStore store = new HashMapDataStore();
- private InstanceIdentifier<?> root = InstanceIdentifier.builder().toInstance();
-
- @Override
- public void start(BundleContext context) throws Exception {
- log.info("Binding Aware Broker initialized");
- baSal = new BindingAwareBrokerImpl();
- baSal.setBrokerBundleContext(context);
- baSal.start();
- baSal.getDataBroker().registerDataReader(root, store);
- baSal.getDataBroker().registerCommitHandler(root, store);
-
- BindingAwareBroker baSalService = baSal;
- Hashtable<String, String> properties = new Hashtable<>();
- this.baSalRegistration = context.registerService(BindingAwareBroker.class, baSalService, properties);
-
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- log.info("Binding Aware Broker stopped");
- baSalRegistration.unregister();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.impl
-
-import org.osgi.framework.ServiceRegistration
-import org.opendaylight.yangtools.yang.binding.RpcService
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration
-
-class RpcServiceRegistrationImpl<T extends RpcService> implements RpcRegistration<T> {
-
- val ServiceRegistration<T> osgiRegistration;
- private val T service;
- val Class<T> cls;
-
- public new(Class<T> type, T service, ServiceRegistration<T> osgiReg) {
- this.cls = type;
- this.osgiRegistration = osgiReg;
- this.service = service;
- }
-
- override getService() {
- this.service
- }
-
- override getInstance() {
- this.service
- }
-
- override close() {
- throw new UnsupportedOperationException("TODO: auto-generated method stub")
- }
-}
+++ /dev/null
-package org.opendaylight.controller.sal.binding.test;
-import static org.junit.Assert.*;
-
-import java.util.concurrent.Future;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.binding.impl.ProxyFactoryGenerator;
-import org.opendaylight.controller.sal.binding.impl.RpcServiceProxy;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-
-public class GenerationTest {
-
- public interface MockService extends RpcService {
-
- Future<RpcResult<java.lang.Void>> cancelToast();
-
- Future<RpcResult<java.lang.Void>> makeToast(String input);
- }
-
- @Test
- public void test() {
- ProxyFactoryGenerator generator = new ProxyFactoryGenerator();
- Class<? extends RpcServiceProxy<MockService>> ret = generator.generate(MockService.class);
-
- assertTrue(RpcServiceProxy.class.isAssignableFrom(ret));
- assertTrue(MockService.class.isAssignableFrom(ret));
- }
-
-}
--- /dev/null
+module opendaylight-sal-binding-broker-impl {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl";
+ prefix "binding-impl";
+
+ import config { prefix config; revision-date 2013-04-05; }
+ import opendaylight-md-sal-binding {prefix sal;}
+
+ description
+ "Service definition for Binding Aware MD-SAL.";
+
+ revision "2013-10-28" {
+ description
+ "Initial revision";
+ }
+
+ identity binding-broker-impl-singleton {
+ base config:module-type;
+ config:provided-service sal:binding-broker-osgi-registry;
+ config:java-name-prefix BindingBrokerImplSingleton;
+ }
+
+ grouping rpc-routing-table {
+
+
+ }
+
+
+ grouping rpc-router {
+ leaf module {
+ type string;
+ }
+ container routing-tables {
+ list routing-table {
+ uses rpc-routing-table;
+ }
+ }
+ }
+
+
+ augment "/config:modules/config:module/config:state" {
+ case binding-broker-impl-singleton {
+ when "/config:modules/config:module/config:type = 'binding-broker-impl-singleton'";
+
+ container rpc-routers {
+ list rpc-router {
+ uses rpc-router;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>sal-binding-config</artifactId>
+ <packaging>bundle</packaging>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>0.5.9-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>
+ org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ </codeGeneratorClass>
+ <outputBaseDir>${project.build.directory}/generated-sources/config</outputBaseDir>
+ <additionalConfiguration>
+ <namespaceToPackage1>
+ urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang
+ </namespaceToPackage1>
+ </additionalConfiguration>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-jmx-generator-plugin</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/config</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-api</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+module opendaylight-md-sal-binding {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding";
+ prefix "md-sal-binding";
+
+ import config { prefix config; revision-date 2013-04-05; }
+
+ description
+ "Service definition for Binding Aware MD-SAL.";
+
+ revision "2013-10-28" {
+ description
+ "Initial revision";
+ }
+
+ identity binding-broker-osgi-registry {
+ base "config:service-type";
+ config:java-class "org.opendaylight.controller.sal.binding.api.BindingAwareBroker";
+ }
+}
\ No newline at end of file
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-manager</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>org.opendaylight.controller.model</groupId>
<artifactId>model-flow-management</artifactId>
<version>1.0-SNAPSHOT</version>
mavenBundle(CONTROLLER, "sal-common").versionAsInProject(), //
mavenBundle(CONTROLLER, "sal-common-api").versionAsInProject(), //
mavenBundle(CONTROLLER, "sal-common-impl").versionAsInProject(), //
+
mavenBundle("com.google.guava", "guava").versionAsInProject(), //
mavenBundle(YANGTOOLS + ".thirdparty", "xtend-lib-osgi").versionAsInProject() //
);
}
+ public static Option configMinumumBundles() {
+ return new DefaultCompositeOption(
+ mavenBundle(CONTROLLER, "config-api").versionAsInProject(), //
+ mavenBundle(CONTROLLER, "config-manager").versionAsInProject(), //
+ mavenBundle("commons-io", "commons-io").versionAsInProject()
+ );
+ }
+
public static Option bindingAwareSalBundles() {
return new DefaultCompositeOption( //
mavenBundle(CONTROLLER, "sal-binding-api").versionAsInProject(), //
+ mavenBundle(CONTROLLER, "sal-binding-config").versionAsInProject(),
mavenBundle(CONTROLLER, "sal-binding-broker-impl").versionAsInProject(), //
mavenBundle("org.javassist", "javassist").versionAsInProject(), //
mavenBundle(CONTROLLER, "sal-common-util").versionAsInProject() //
mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
+ configMinumumBundles(),
+
mdSalCoreBundles(),
bindingAwareSalBundles(),
import static org.mockito.Mockito.verify;
import java.math.BigInteger;
+import java.util.concurrent.Future;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.sal.binding.api.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
public class RoutedServiceTest extends AbstractTest {
</executions>
</plugin>
<plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <configuration>
- <includes>org.opendaylight.controller.*</includes>
- </configuration>
- <executions>
- <execution>
- <id>pre-test</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>post-test</id>
- <phase>test</phase>
- <goals>
- <goal>report</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration>
+ <includes>org.opendaylight.controller.*</includes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>pre-test</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>post-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
+ <!--This plugin's configuration is used to store Eclipse
+ m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>${exam.version}</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-manager</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>equinoxSDK381</groupId>
<artifactId>org.eclipse.osgi</artifactId>
mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
mavenBundle(ODL, "sal-binding-api").versionAsInProject(), //
+ mavenBundle(ODL, "sal-binding-config").versionAsInProject(),
mavenBundle(ODL, "sal-binding-broker-impl").versionAsInProject(), //
+
mavenBundle(ODL, "sal-common").versionAsInProject(), //
mavenBundle(ODL, "sal-common-api").versionAsInProject(),//
mavenBundle(ODL, "sal-common-impl").versionAsInProject(), //
mavenBundle(ODL, "sal-common-util").versionAsInProject(), //
+
+ mavenBundle(ODL, "config-api").versionAsInProject(), //
+ mavenBundle(ODL, "config-manager").versionAsInProject(), //
+ mavenBundle("commons-io", "commons-io").versionAsInProject(),
+
+
mavenBundle(SAMPLE, "sample-toaster").versionAsInProject(), //
mavenBundle(SAMPLE, "sample-toaster-consumer").versionAsInProject(), //
mavenBundle(SAMPLE, "sample-toaster-provider").versionAsInProject(), //