import org.opendaylight.controller.sal.connection.IPluginInConnectionService;
import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
+import org.opendaylight.controller.sal.core.IContainerAware;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
protected static final Logger logger = LoggerFactory
.getLogger(Activator.class);
- /**
- * Function called when the activator starts just after some initializations
- * are done by the ComponentActivatorAbstractBase.
- *
- */
- public void init() {
- }
-
- /**
- * Function called when the activator stops just before the cleanup done by
- * ComponentActivatorAbstractBase
- *
- */
- public void destroy() {
- }
/**
* Function that is used to communicate to dependency manager the list of
* instantiated in order to get an fully working implementation
* Object
*/
+ @Override
public Object[] getImplementations() {
Object[] res = { TopologyServices.class, DataPacketServices.class,
InventoryService.class, ReadService.class,
* 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(TopologyServices.class)) {
// export the service to be used by SAL
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(ReadService.class)) {
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(FlowProgrammerNotifier.class)) {
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
}
* instantiated in order to get an fully working implementation
* Object
*/
+ @Override
public Object[] getGlobalImplementations() {
Object[] res = { Controller.class, OFStatisticsManager.class,
FlowProgrammerService.class, ReadServiceFilter.class,
* Implementation class that is being configured, needed as long
* as the same routine can configure multiple implementations
*/
+ @Override
public void configureGlobalInstance(Component c, Object imp) {
if (imp.equals(Controller.class)) {
// by SAL
props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), Node.NodeIDType.OPENFLOW);
c.setInterface(
- new String[] {
- IPluginInFlowProgrammerService.class.getName(),
- IMessageListener.class.getName(),
- IContainerListener.class.getName(),
- IInventoryShimExternalListener.class.getName() },
- props);
+ new String[] { IPluginInFlowProgrammerService.class.getName(), IMessageListener.class.getName(),
+ IContainerListener.class.getName(), IInventoryShimExternalListener.class.getName(),
+ IContainerAware.class.getName() }, props);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
c.add(createServiceDependency()
.setService(IFlowProgrammerNotifier.class)
.setCallbacks("setFlowProgrammerNotifier",
- "unsetsetFlowProgrammerNotifier")
+ "unsetFlowProgrammerNotifier")
.setRequired(false));
c.add(createServiceDependency()
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(ReadServiceFilter.class)) {
- c.setInterface(new String[] {
- IReadServiceFilter.class.getName(),
- IContainerListener.class.getName(),
- IOFStatisticsListener.class.getName() }, null);
+ c.setInterface(new String[] { IReadServiceFilter.class.getName(), IContainerListener.class.getName(),
+ IOFStatisticsListener.class.getName(), IContainerAware.class.getName() }, null);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
if (imp.equals(DiscoveryService.class)) {
// export the service
c.setInterface(
- new String[] {
- IInventoryShimExternalListener.class.getName(),
- IDataPacketListen.class.getName(),
+ new String[] { IInventoryShimExternalListener.class.getName(), IDataPacketListen.class.getName(),
IContainerListener.class.getName() }, null);
c.add(createServiceDependency()
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
// DataPacket mux/demux services, which is teh actual engine
// doing the packet switching
if (imp.equals(DataPacketMuxDemux.class)) {
- c.setInterface(new String[] { IDataPacketMux.class.getName(),
- IContainerListener.class.getName(),
- IInventoryShimExternalListener.class.getName() }, null);
+ c.setInterface(new String[] { IDataPacketMux.class.getName(), IContainerListener.class.getName(),
+ IInventoryShimExternalListener.class.getName(), IContainerAware.class.getName() }, null);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(InventoryService.class)) {
.setService(IPluginOutInventoryService.class, "(scope=Global)")
.setCallbacks("setPluginOutInventoryServices",
"unsetPluginOutInventoryServices")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(InventoryServiceShim.class)) {
c.setInterface(new String[] { IContainerListener.class.getName(),
- IOFStatisticsListener.class.getName()}, null);
+ IOFStatisticsListener.class.getName(), IContainerAware.class.getName() }, null);
c.add(createServiceDependency()
.setService(IController.class, "(name=Controller)")
.setService(IPluginOutConnectionService.class)
.setCallbacks("setIPluginOutConnectionService",
"unsetIPluginOutConnectionService")
- .setRequired(false));
+ .setRequired(true));
}
if (imp.equals(TopologyServiceShim.class)) {
- c.setInterface(new String[] { IDiscoveryListener.class.getName(),
- IContainerListener.class.getName(),
- IRefreshInternalProvider.class.getName(),
- IInventoryShimExternalListener.class.getName() }, null);
+ c.setInterface(new String[] { IDiscoveryListener.class.getName(), IContainerListener.class.getName(),
+ IRefreshInternalProvider.class.getName(), IInventoryShimExternalListener.class.getName(),
+ IContainerAware.class.getName() }, null);
c.add(createServiceDependency()
.setService(ITopologyServiceShimListener.class)
.setCallbacks("setTopologyServiceShimListener",