1 package org.opendaylight.controller.protocol_plugins.stub.internal;
3 import java.util.Dictionary;
4 import java.util.Hashtable;
6 import org.apache.felix.dm.Component;
8 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
9 import org.opendaylight.controller.sal.core.IContainerListener;
10 import org.opendaylight.controller.sal.core.Node;
11 import org.opendaylight.controller.sal.discovery.IDiscoveryService;
12 import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
13 import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
14 import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
15 import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
16 import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
17 import org.opendaylight.controller.sal.reader.IPluginInReadService;
18 import org.opendaylight.controller.sal.reader.IReadService;
19 import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
20 import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
21 import org.opendaylight.controller.sal.utils.GlobalConstants;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
27 * stub protocol plugin Activator
31 public class Activator extends ComponentActivatorAbstractBase {
32 protected static final Logger logger = LoggerFactory
33 .getLogger(Activator.class);
36 * Function called when the activator starts just after some initializations
37 * are done by the ComponentActivatorAbstractBase.
44 * Function called when the activator stops just before the cleanup done by
45 * ComponentActivatorAbstractBase
48 public void destroy() {
52 * Function that is used to communicate to dependency manager the list of
53 * known implementations for services inside a container
56 * @return An array containing all the CLASS objects that will be
57 * instantiated in order to get an fully working implementation
60 public Object[] getImplementations() {
61 Object[] res = { ReadService.class, InventoryService.class };
66 * Function that is called when configuration of the dependencies is
70 * dependency manager Component object, used for configuring the
71 * dependencies exported and imported
73 * Implementation class that is being configured, needed as long
74 * as the same routine can configure multiple implementations
75 * @param containerName
76 * The containerName being configured, this allow also optional
77 * per-container different behavior if needed, usually should not
80 public void configureInstance(Component c, Object imp, String containerName) {
81 if (imp.equals(ReadService.class)) {
82 // export the service to be used by SAL
83 Dictionary<String, Object> props = new Hashtable<String, Object>();
84 // Set the protocolPluginType property which will be used
86 props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
87 c.setInterface(IPluginInReadService.class.getName(), props);
90 if (imp.equals(InventoryService.class)) {
91 // export the service to be used by SAL
92 Dictionary<String, Object> props = new Hashtable<String, Object>();
93 // Set the protocolPluginType property which will be used
95 props.put("protocolPluginType", Node.NodeIDType.OPENFLOW);
96 c.setInterface(IPluginInInventoryService.class.getName(), props);