本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}