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
+
+NOTE: This file is deprecated as wiring is now done via blueprint. This file is kept for
+ backwards compatibility. Runtime modifications are not honored.
-->
<snapshot>
<required-capabilities>
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class InventoryActivator implements BindingAwareProvider, AutoCloseable {
+public class InventoryActivator implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(InventoryActivator.class);
- private FlowCapableInventoryProvider provider;
- final private EntityOwnershipService eos;
-
- public InventoryActivator(EntityOwnershipService eos) {
- this.eos = eos;
- }
+ private final FlowCapableInventoryProvider provider;
- @Override
- public void onSessionInitiated(final ProviderContext session) {
- DataBroker dataBroker = session.getSALService(DataBroker.class);
- NotificationProviderService salNotifiService =
- session.getSALService(NotificationProviderService.class);
+ public InventoryActivator(DataBroker dataBroker, NotificationProviderService notificationService,
+ EntityOwnershipService eos) {
+ provider = new FlowCapableInventoryProvider(dataBroker, notificationService, eos);
+ }
- provider = new FlowCapableInventoryProvider(dataBroker, salNotifiService, eos);
+ public void start() {
provider.start();
}
@Override
- public void close() throws Exception {
- if (provider != null) {
- try {
- provider.close();
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting for shutdown", e);
- }
- provider = null;
+ public void close() {
+ try {
+ provider.close();
+ } catch (InterruptedException e) {
+ LOG.warn("Interrupted while waiting for shutdown", e);
}
}
}
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.inventory.manager.impl.rev150530;
-import org.opendaylight.openflowplugin.applications.inventory.manager.InventoryActivator;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
-public class InventoryManagerImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.inventory.manager.impl.rev150530.AbstractInventoryManagerImplModule {
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class InventoryManagerImplModule extends AbstractInventoryManagerImplModule {
public InventoryManagerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
}
@Override
- public void customValidation() {
- // add custom validation form module attributes here.
+ public AutoCloseable createInstance() {
+ // InventoryActivator instance is created via blueprint so this in a no-op.
+ return NoopAutoCloseable.INSTANCE;
}
-
- @Override
- public java.lang.AutoCloseable createInstance() {
- InventoryActivator provider = new InventoryActivator(getEntityOwnershipServiceDependency());
- getBrokerDependency().registerProvider(provider);
- return provider;
- }
-
}
* Do not modify this file unless it is present under src/main directory
*/
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.inventory.manager.impl.rev150530;
-public class InventoryManagerImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.inventory.manager.impl.rev150530.AbstractInventoryManagerImplModuleFactory {
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class InventoryManagerImplModuleFactory extends AbstractInventoryManagerImplModuleFactory {
}
identity inventory-manager-impl {
base config:module-type;
config:java-name-prefix InventoryManagerImpl;
+ status deprecated;
}
augment "/config:modules/config:module/config:configuration" {
<argument ref="entityOwnershipService"/>
</bean>
+ <!-- Create the Inventory manager/provider -->
+ <bean id="inventoryManager" class="org.opendaylight.openflowplugin.applications.inventory.manager.InventoryActivator"
+ init-method="start" destroy-method="close">
+ <argument ref="dataBroker"/>
+ <argument ref="notificationService"/>
+ <argument ref="entityOwnershipService"/>
+ </bean>
+
<reference id="switchConnProviderFactory"
interface="org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderFactory"/>
<!-- Create OpenflowPluginProvider instance -->
<bean id="openflowPluginProvider" class="org.opendaylight.openflowplugin.openflow.md.core.sal.OpenflowPluginProvider"
- init-method="initialization" destroy-method="close" depends-on="statsManager">
+ init-method="initialization" destroy-method="close" depends-on="statsManager inventoryManager">
<property name="dataBroker" ref="dataBroker"/>
<property name="rpcRegistry" ref="rpcRegistry"/>
<property name="notificationService" ref="notificationService"/>