X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fstub%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugins%2Fstub%2Finternal%2FActivator.java;h=9c47b3b9839dec497ff8dc0d6a23d3e896aad35d;hp=580dabba35a6b0ccfbe591f8cc3e288013e600ec;hb=27152eea5daa9611915b162425970d67594a1bc1;hpb=d34ec441f8a5f16186e927fc18fa527b9b6ee8e5 diff --git a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java index 580dabba35..9c47b3b983 100644 --- a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java +++ b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/Activator.java @@ -7,6 +7,7 @@ import org.apache.felix.dm.Component; import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase; import org.opendaylight.controller.sal.core.IContainerListener; +import org.opendaylight.controller.sal.utils.INodeFactory; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector; import org.opendaylight.controller.sal.discovery.IDiscoveryService; @@ -101,4 +102,29 @@ public class Activator extends ComponentActivatorAbstractBase { c.setInterface(IPluginInInventoryService.class.getName(), props); } } + + public Object[] getGlobalImplementations() { + Object[] res = { FlowProgrammerService.class, StubNodeFactory.class }; + return res; + } + + public void configureGlobalInstance(Component c, Object imp){ + if (imp.equals(FlowProgrammerService.class)) { + // export the service to be used by SAL + Dictionary props = new Hashtable(); + // Set the protocolPluginType property which will be used + // by SAL + props.put("protocolPluginType", "STUB"); + c.setInterface(IPluginInFlowProgrammerService.class.getName(), props); + } + if (imp.equals(StubNodeFactory.class)) { + // export the service to be used by SAL + Dictionary props = new Hashtable(); + // Set the protocolPluginType property which will be used + // by SAL + props.put("protocolPluginType", "STUB"); + props.put("protocolName", "STUB"); + c.setInterface(INodeFactory.class.getName(), props); + } + } }