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


Java IOFConnectionBackend.setListener方法代码示例

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


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

示例1: OFSwitchHandshakeHandler

import net.floodlightcontroller.core.IOFConnectionBackend; //导入方法依赖的package包/类
/**
 * Create a new unconnected OFChannelHandler.
 * @param controller
 * @param broker
 * @throws SwitchHandshakeHandlerException
 */
OFSwitchHandshakeHandler(@Nonnull IOFConnectionBackend connection,
		@Nonnull OFFeaturesReply featuresReply,
		@Nonnull IOFSwitchManager switchManager,
		@Nonnull RoleManager roleManager,
		@Nonnull Timer timer) {
	Preconditions.checkNotNull(connection, "connection");
	Preconditions.checkNotNull(featuresReply, "featuresReply");
	Preconditions.checkNotNull(switchManager, "switchManager");
	Preconditions.checkNotNull(roleManager, "roleManager");
	Preconditions.checkNotNull(timer, "timer");
	Preconditions.checkArgument(connection.getAuxId().equals(OFAuxId.MAIN),
			"connection must be MAIN connection but is %s", connection);

	this.switchManager = switchManager;
	this.roleManager = roleManager;
	this.mainConnection = connection;
	this.auxConnections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
	this.featuresReply = featuresReply;
	this.timer = timer;
	this.switchManagerCounters = switchManager.getCounters();
	this.factory = OFFactories.getFactory(featuresReply.getVersion());
	this.roleChanger = new RoleChanger(DEFAULT_ROLE_TIMEOUT_NS);
	setState(new InitState());
	this.pendingPortStatusMsg = new ArrayList<OFPortStatus>();

	connection.setListener(this);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:34,代码来源:OFSwitchHandshakeHandler.java

示例2: auxConnectionOpened

import net.floodlightcontroller.core.IOFConnectionBackend; //导入方法依赖的package包/类
/**
 * Called by the switch manager when new aux connections have connected.
 * This alerts the state machine of an aux connection.
 *
 * @param connection
 *            the aux connection
 */
public synchronized void auxConnectionOpened(IOFConnectionBackend connection) {
	if(log.isDebugEnabled())
		log.debug("[{}] - Switch Handshake - new aux connection {}", this.getDpid(), connection.getAuxId());

	// Handle new Auxiliary connections if the main connection has completed (i.e. in ACTIVE or STANDBY state)
	if (this.getState().equals("ACTIVE") || this.getState().equals("STANDBY")) {
		auxConnections.put(connection.getAuxId(), connection);
		connection.setListener(OFSwitchHandshakeHandler.this);
		log.info("Auxiliary connection {} added for {}.", connection.getAuxId().getValue(), connection.getDatapathId().toString());
	} else {
		log.info("Auxiliary connection {} initiated for {} before main connection handshake complete. Ignorning aux connection attempt.", connection.getAuxId().getValue(), connection.getDatapathId().toString());
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:21,代码来源:OFSwitchHandshakeHandler.java


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