当前位置: 首页>>代码示例>>Java>>正文


Java ListenerDispatcher.addListener方法代码示例

本文整理汇总了Java中net.floodlightcontroller.core.util.ListenerDispatcher.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java ListenerDispatcher.addListener方法的具体用法?Java ListenerDispatcher.addListener怎么用?Java ListenerDispatcher.addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.core.util.ListenerDispatcher的用法示例。


在下文中一共展示了ListenerDispatcher.addListener方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type,
                                              IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd =
            listeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        listeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:12,代码来源:MockFloodlightProvider.java

示例2: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type, IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd =
        messageListeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        messageListeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:Controller.java

示例3: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type,
                                              IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd =
        messageListeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        messageListeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:12,代码来源:Controller.java

示例4: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type, 
                                              IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd = 
        messageListeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        messageListeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:12,代码来源:Controller.java

示例5: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type, 
                                              IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd = 
            listeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        listeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:12,代码来源:MockFloodlightProvider.java

示例6: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type,
        IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd =
            messageListeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        messageListeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:12,代码来源:Controller.java

示例7: addOFMessageListener

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Override
public synchronized void addOFMessageListener(OFType type,
        IOFMessageListener listener) {
    ListenerDispatcher<OFType, IOFMessageListener> ldd =
            listeners.get(type);
    if (ldd == null) {
        ldd = new ListenerDispatcher<OFType, IOFMessageListener>();
        listeners.put(type, ldd);
    }
    ldd.addListener(type, listener);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:12,代码来源:MockFloodlightProvider.java

示例8: testVendorMessageUnknown

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Test
public void testVendorMessageUnknown() throws Exception {
    // Check behavior with an unknown vendor id
    // Ensure that vendor message listeners get called, even for Vendors
    // unknown to floodlight. It is the responsibility of the listener to
    // discard unknown vendors.
    OFChannelState state = new OFChannelState();
    state.hsState = HandshakeState.READY;
    Controller.OFChannelHandler chdlr = controller.new OFChannelHandler(state);
    OFVendor msg = new OFVendor();
    msg.setVendor(0);
    IOFSwitch sw = createMock(IOFSwitch.class);
    chdlr.sw = sw;
    controller.activeSwitches.put(1L, sw);

    // prepare the Vendor Message Listener expectations
    ListenerDispatcher<OFType, IOFMessageListener> ld =
            new ListenerDispatcher<OFType, IOFMessageListener>();
    IOFMessageListener ml = createMock(IOFMessageListener.class);
    expect(ml.getName()).andReturn("Dummy").anyTimes();
    expect(ml.isCallbackOrderingPrereq((OFType)anyObject(),
            (String)anyObject())).andReturn(false).anyTimes();
    expect(ml.isCallbackOrderingPostreq((OFType)anyObject(),
            (String)anyObject())).andReturn(false).anyTimes();
    expect(ml.receive(eq(sw), eq(msg), isA(FloodlightContext.class))).
            andReturn(Command.CONTINUE).once();
    controller.messageListeners.put(OFType.VENDOR, ld);

    // prepare the switch and lock expectations
    Lock lock = createNiceMock(Lock.class);
    expect(sw.getListenerReadLock()).andReturn(lock).anyTimes();
    expect(sw.isConnected()).andReturn(true).anyTimes();
    expect(sw.getHARole()).andReturn(Role.MASTER).anyTimes();
    expect(sw.getId()).andReturn(1L).anyTimes();

    // test
    replay(chdlr.sw, lock, ml);
    ld.addListener(OFType.VENDOR, ml);
    chdlr.processOFMessage(msg);
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:41,代码来源:ControllerTest.java

示例9: testVendorMessageUnknown

import net.floodlightcontroller.core.util.ListenerDispatcher; //导入方法依赖的package包/类
@Test 
public void testVendorMessageUnknown() throws Exception {
    // Check behavior with an unknown vendor id
    // Ensure that vendor message listeners get called, even for Vendors 
    // unknown to floodlight. It is the responsibility of the listener to
    // discard unknown vendors.
    OFChannelState state = new OFChannelState();
    state.hsState = HandshakeState.READY;
    Controller.OFChannelHandler chdlr = controller.new OFChannelHandler(state);
    OFVendor msg = new OFVendor();
    msg.setVendor(0);
    IOFSwitch sw = createMock(IOFSwitch.class);
    chdlr.sw = sw;
    controller.activeSwitches.put(1L, sw);
    
    // prepare the Vendor Message Listener expectations
    ListenerDispatcher<OFType, IOFMessageListener> ld = 
            new ListenerDispatcher<OFType, IOFMessageListener>();
    IOFMessageListener ml = createMock(IOFMessageListener.class);
    expect(ml.getName()).andReturn("Dummy").anyTimes();
    expect(ml.isCallbackOrderingPrereq((OFType)anyObject(), 
            (String)anyObject())).andReturn(false).anyTimes();
    expect(ml.isCallbackOrderingPostreq((OFType)anyObject(), 
            (String)anyObject())).andReturn(false).anyTimes();
    expect(ml.receive(eq(sw), eq(msg), isA(FloodlightContext.class))).
            andReturn(Command.CONTINUE).once();
    controller.messageListeners.put(OFType.VENDOR, ld);

    // prepare the switch and lock expectations
    Lock lock = createNiceMock(Lock.class);
    expect(sw.getListenerReadLock()).andReturn(lock).anyTimes();
    expect(sw.isConnected()).andReturn(true).anyTimes();
    expect(sw.getHARole()).andReturn(Role.MASTER).anyTimes();
    expect(sw.getId()).andReturn(1L).anyTimes();
    
    // test
    replay(chdlr.sw, lock, ml);
    ld.addListener(OFType.VENDOR, ml);
    chdlr.processOFMessage(msg);
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:41,代码来源:ControllerTest.java


注:本文中的net.floodlightcontroller.core.util.ListenerDispatcher.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。