• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BindingAwareBroker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.controller.sal.binding.api.BindingAwareBroker的典型用法代码示例。如果您正苦于以下问题:Java BindingAwareBroker类的具体用法?Java BindingAwareBroker怎么用?Java BindingAwareBroker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BindingAwareBroker类属于org.opendaylight.controller.sal.binding.api包,在下文中一共展示了BindingAwareBroker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerEventSourceTest

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void registerEventSourceTest() throws Exception {
    topicTestHelper();
    Node nodeMock = mock(Node.class);
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    doReturn(nodeKey).when(nodeMock).getKey();
    doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
    doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
    assertNotNull("Return value has not been created correctly.", eventSourceTopology.registerEventSource(eventSourceMock));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:EventSourceTopologyTest.java


示例2: testCreateInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
    // configure mocks
    DependencyResolver dependencyResolver = mock(DependencyResolver.class);
    BindingAwareBroker broker = mock(BindingAwareBroker.class);
    when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);

    // create instance of module with injected mocks
    HelloModule module = new HelloModule(mock(ModuleIdentifier.class), dependencyResolver);

    // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
    AutoCloseable closeable = module.getInstance();

    // verify that the module registered the returned provider with the broker
    verify(broker).registerProvider((HelloProvider)closeable);

    // ensure no exceptions on close
    closeable.close();
}
 
开发者ID:lrodrin,项目名称:opendaylight,代码行数:20,代码来源:HelloModuleTest.java


示例3: testCreateInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
    // configure mocks
    DependencyResolver dependencyResolver = mock(DependencyResolver.class);
    BindingAwareBroker broker = mock(BindingAwareBroker.class);
    when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);

    // create instance of module with injected mocks
    SdnaModule module = new SdnaModule(mock(ModuleIdentifier.class), dependencyResolver);

    // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
    AutoCloseable closeable = module.getInstance();

    // verify that the module registered the returned provider with the broker
    verify(broker).registerProvider((SdnaProvider)closeable);

    // ensure no exceptions on close
    closeable.close();
}
 
开发者ID:hashcms,项目名称:sdna,代码行数:20,代码来源:SdnaModuleTest.java


示例4: testCreateInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void testCreateInstance() throws Exception {
    // configure mocks
    DependencyResolver dependencyResolver = mock(DependencyResolver.class);
    BindingAwareBroker broker = mock(BindingAwareBroker.class);
    when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);

    // create instance of module with injected mocks
    ExampleModule module = new ExampleModule(mock(ModuleIdentifier.class), dependencyResolver);

    // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
    AutoCloseable closeable = module.getInstance();

    // verify that the module registered the returned provider with the broker
    verify(broker).registerProvider((ExampleProvider)closeable);

    // ensure no exceptions on close
    closeable.close();
}
 
开发者ID:geopet85,项目名称:odlexample,代码行数:20,代码来源:ExampleModuleTest.java


示例5: createInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public java.lang.AutoCloseable createInstance() {
	BindingAwareBroker bindingAwareBroker = getBindingAwareBrokerDependency();
    DataBroker dataBrokerService = getDataBrokerDependency();
    RpcProviderRegistry rpcProviderRegistry = getRpcRegistryDependency();
    NotificationProviderService notificationService = getNotificationServiceDependency();

    Preconditions.checkNotNull(bindingAwareBroker);
    Preconditions.checkNotNull(dataBrokerService);
    Preconditions.checkNotNull(rpcProviderRegistry);
    Preconditions.checkNotNull(notificationService);

    MyRouterOrchestrator orchestrator = new MyRouterOrchestrator(bindingAwareBroker, dataBrokerService, notificationService, rpcProviderRegistry);
    LOG.info("Tutorial NetconfExercise (instance {}) initialized.", orchestrator);
    return orchestrator;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:17,代码来源:TutorialNetconfExerciseModule.java


示例6: configureInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies is
 * required.
 *
 * @param c
 *            dependency manager Component object, used for configuring the
 *            dependencies exported and imported
 * @param imp
 *            Implementation class that is being configured, needed as long
 *            as the same routine can configure multiple implementations
 * @param containerName
 *            The containerName being configured, this allow also optional
 *            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(NetworkHandler.class)) {
        c.setInterface(INeutronNetworkAware.class.getName(), null);
    }
    if (imp.equals(SubnetHandler.class)) {
        c.setInterface(INeutronSubnetAware.class.getName(), null);
    }
    if (imp.equals(PortHandler.class)) {
        c.setInterface(INeutronPortAware.class.getName(), null);
    }
    // Create service dependencies.
    c.add(createServiceDependency().setService(BindingAwareBroker.class).setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker")
            .setRequired(true));
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:31,代码来源:Activator.java


示例7: registerTest

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void registerTest() throws Exception {
    topicTestHelper();
    Node nodeMock = mock(Node.class);
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    doReturn(nodeKey).when(nodeMock).getKey();
    doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
    doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
    eventSourceTopology.register(eventSourceMock);
    verify(routedRpcRegistrationMock, times(1)).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:EventSourceTopologyTest.java


示例8: unregisterTest

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Test
public void unregisterTest() throws Exception {
    topicTestHelper();
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    Map<NodeKey, BindingAwareBroker.RoutedRpcRegistration<EventSourceService>> localMap = getRoutedRpcRegistrations();
    NodeKey nodeKeyMock = mock(NodeKey.class);
    doReturn(nodeKeyMock).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration<EventSourceService> routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    localMap.put(nodeKeyMock, routedRpcRegistrationMock);
    eventSourceTopology.unRegister(eventSourceMock);
    verify(routedRpcRegistrationMock, times(1)).close();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:EventSourceTopologyTest.java


示例9: MyRouterOrchestrator

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
public MyRouterOrchestrator(BindingAwareBroker bindingAwareBroker, DataBroker dataBroker, NotificationProviderService notificationService, RpcProviderRegistry rpcProviderRegistry) {
    //Register this object as a provider for receiving session context
    bindingAwareBroker.registerProvider(this);
    
    //Register this object as listener for changes in netconf topology
    InstanceIdentifier<Topology> netconfTopoIID = InstanceIdentifier.builder(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
            .build();
    registrations.add(dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, netconfTopoIID.child(Node.class), this, DataChangeScope.SUBTREE));
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:11,代码来源:MyRouterOrchestrator.java


示例10: onSessionInitiated

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) {
    LOG.info("BindingAwareBroker.ProviderContext initialized");
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:Providers.java


示例11: setRpcRegistration

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
public void setRpcRegistration(final BindingAwareBroker.RoutedRpcRegistration<CarPurchaseService> rpcRegistration) {
  this.rpcRegistration = rpcRegistration;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:PeopleProvider.java


示例12: configureInstance

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies is
 * required.
 *
 *@param c
 *            dependency manager Component object, used for configuring the
 *            dependencies exported and imported
 *@param imp
 *            Implementation class that is being configured, needed as long
 *            as the same routine can configure multiple implementations
 * @param containerName
 *            The containerName being configured, this allow also optional
 *            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(NetworkHandler.class)) {
        c.setInterface(INeutronNetworkAware.class.getName(), null);
    }
    if (imp.equals(SubnetHandler.class)) {
        c.setInterface(INeutronSubnetAware.class.getName(), null);
    }
    if (imp.equals(PortHandler.class)) {
        c.setInterface(INeutronPortAware.class.getName(), null);
    }
    if (imp.equals(RouterHandler.class)) {
        c.setInterface(INeutronRouterAware.class.getName(), null);
    }
    if (imp.equals(FloatingIpHandler.class)) {
        c.setInterface(INeutronFloatingIPAware.class.getName(), null);
    }
    if (imp.equals(SecurityGroupHandler.class)) {
        c.setInterface(INeutronSecurityGroupAware.class.getName(), null);
    }
    if (imp.equals(SecurityGroupRulesHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    if (imp.equals(LoadBalancerHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    if (imp.equals(LoadBalancerHealthMonitorHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    if (imp.equals(LoadBalancerListenerHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    if (imp.equals(LoadBalancerPoolHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    if (imp.equals(LoadBalancerPoolMemberHandler.class)) {
        c.setInterface(INeutronSecurityRuleAware.class.getName(), null);
    }
    // Create service dependencies.
    c.add(createServiceDependency().setService(BindingAwareBroker.class).setCallbacks("setBindingAwareBroker", "unsetBindingAwareBroker")
            .setRequired(true));
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:58,代码来源:Activator.java


示例13: getDatabroker

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
/**
 * Get a DataBroker and assert that it is not null.
 * @param providerContext ProviderContext from which to retrieve the DataBroker
 * @return the Databroker
 */
public static DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
    DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
    assertNotNull("dataBroker should not be null", dataBroker);
    return dataBroker;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:OvsdbItUtils.java


示例14: setBroker

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
@Override
public void setBroker(BindingAwareBroker broker) {
    this.broker = broker;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:NotificationModule.java


示例15: setBroker

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; //导入依赖的package包/类
void setBroker(BindingAwareBroker broker); 
开发者ID:lbchen,项目名称:ODL,代码行数:2,代码来源:SALBindingModule.java



注:本文中的org.opendaylight.controller.sal.binding.api.BindingAwareBroker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FBUtilities类代码示例发布时间:2022-05-21
下一篇:
Java SolarisPrincipal类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap