本文整理汇总了Java中org.androidpn.server.xmpp.net.Connection.init方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.init方法的具体用法?Java Connection.init怎么用?Java Connection.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.androidpn.server.xmpp.net.Connection
的用法示例。
在下文中一共展示了Connection.init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createClientSession
import org.androidpn.server.xmpp.net.Connection; //导入方法依赖的package包/类
/**
* 根据连接创建一个新的客户端会话并返回
*
* @param conn
* @return
*/
public ClientSession createClientSession(Connection conn) {
if (serverName == null) {
throw new IllegalStateException("服务未初始化");
}
Random random = new Random();
String streamId = Integer.toHexString(random.nextInt());
ClientSession session = new ClientSession(serverName, conn, streamId);
conn.init(session);
conn.registerCloseListener(clientSessionListener);
// 添加到预认证会话集中
preAuthSessions.put(session.getAddress().getResource(), session);
// 用户会话计数器执行自增
connectionsCounter.incrementAndGet();
log.debug("一个客户端会话创建完成.");
return session;
}
示例2: createClientSession
import org.androidpn.server.xmpp.net.Connection; //导入方法依赖的package包/类
/**
* Creates a new ClientSession and returns it.
*
* @param conn the connection
* @return a newly created session
*/
public ClientSession createClientSession(Connection conn) {
if (serverName == null) {
throw new IllegalStateException("Server not initialized");
}
Random random = new Random();
String streamId = Integer.toHexString(random.nextInt());
ClientSession session = new ClientSession(serverName, conn, streamId);
conn.init(session);
conn.registerCloseListener(clientSessionListener);
// Add to pre-authenticated sessions
preAuthSessions.put(session.getAddress().getResource(), session);
// Increment the counter of user sessions
connectionsCounter.incrementAndGet();
log.debug("ClientSession created.");
return session;
}
示例3: createClientSession
import org.androidpn.server.xmpp.net.Connection; //导入方法依赖的package包/类
public ClientSession createClientSession(Connection conn, String streamId) {
if (serverName == null) {
throw new IllegalStateException("Server not initialized");
}
ClientSession session = new ClientSession(serverName, conn, streamId);
conn.init(session);
// Register to receive close notification on this session
conn.registerCloseListener(clientSessionListener, session);
// Add to pre-authenticated sessions
preAuthSessions.put(session.getAddress().getResource(), session);
// Increment the counter of user sessions
connectionsCounter.incrementAndGet();
log.debug("ClientSession created.");
return session;
}
示例4: createClientSession
import org.androidpn.server.xmpp.net.Connection; //导入方法依赖的package包/类
public ClientSession createClientSession(Connection conn, String streamId) {
if (serverName == null) {
throw new IllegalStateException("Server not initialized");
}
ClientSession session = new ClientSession(serverName, conn, streamId);
conn.init(session);
// Register to receive close notification on this session
conn.registerCloseListener(clientSessionListener, session);
// Add to pre-authenticated sessions
preAuthSessions.put(session.getAddress().getResource(), session);
// Increment the counter of user sessions
connectionsCounter.incrementAndGet();
return session;
}
示例5: createClientSession
import org.androidpn.server.xmpp.net.Connection; //导入方法依赖的package包/类
public ClientSession createClientSession(Connection conn, String streamId) {
if (serverName == null) {
throw new IllegalStateException("Server not initialized");
}
ClientSession session = new ClientSession(serverName, conn, streamId);
conn.init(session);
// Add to pre-authenticated sessions
preAuthSessions.put(session.getAddress().getResource(), session);
// Increment the counter of user sessions
connectionsCounter.incrementAndGet();
return session;
}