當前位置: 首頁>>代碼示例>>Java>>正文


Java IClientRegistry類代碼示例

本文整理匯總了Java中org.red5.server.api.IClientRegistry的典型用法代碼示例。如果您正苦於以下問題:Java IClientRegistry類的具體用法?Java IClientRegistry怎麽用?Java IClientRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IClientRegistry類屬於org.red5.server.api包,在下文中一共展示了IClientRegistry類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: connectionHandler

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
@Test
public void connectionHandler() {
	context = (Context) applicationContext.getBean("web.context");
	TestConnection conn = new TestConnection(host, "/", null);
	// add the connection to thread local
	Red5.setConnectionLocal(conn);
	// resolve root
	IScope scope = context.resolveScope("/");
	IClientRegistry reg = context.getClientRegistry();
	IClient client = reg.newClient(null);
	assertNotNull(client);

	log.debug("----------------------------------\nDump scope details");
	((Scope) scope).dump();
	log.debug("----------------------------------\n");

	conn.initialize(client);
	if (!conn.connect(scope)) {
		assertTrue("didnt connect", false);
	} else {
		assertTrue("should have a scope", conn.getScope() != null);
		conn.close();
		assertTrue("should not be connected", !conn.isConnected());
	}
	Red5.setConnectionLocal(null);
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:27,代碼來源:ScopeTest.java

示例2: createConnection

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
private IConnection createConnection(int id) {
	//create our sender conn and set local
	IClientRegistry dummyReg = (IClientRegistry) applicationContext.getBean("global.clientRegistry");

	IScope scp = (WebScope) applicationContext.getBean("web.scope");
	//IContext ctx = (Context) applicationContext.getBean("web.context");

	IConnection conn = new SvcCapableTestConnection("localhost", "/junit", id + "");//host, path, session id
	IClient rClient = dummyReg.newClient(new Object[] { "client-" + id });
	((TestConnection) conn).setClient(rClient);
	((TestConnection) conn).setScope((Scope) scp);
	((DummyClient) rClient).registerConnection(conn);

	return conn;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:16,代碼來源:ServiceInvokerTest.java

示例3: handler

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
@Test
public void handler() {
	context = (Context) applicationContext.getBean("web.context");

	Scope testApp = (Scope) context.resolveScope(appPath);
	assertTrue("should have a handler", testApp.hasHandler());

	IClientRegistry reg = context.getClientRegistry();
	IClient client = reg.newClient(null);

	TestConnection conn = new TestConnection(host, appPath, client.getId());
	conn.initialize(client);

	Red5.setConnectionLocal(conn);

	assertTrue("client should not be null", client != null);
	log.debug("{}", client);

	String key = "key";
	String value = "value";
	client.setAttribute(key, value);
	assertTrue("attributes not working", client.getAttribute(key) == value);

	assertTrue(conn.connect(testApp));

	assertTrue("app should have 1 client", testApp.getClients().size() == 1);
	assertTrue("host should have 1 client", testApp.getParent().getClients().size() == 1);

	conn.close();

	assertTrue("app should have 0 client", testApp.getClients().size() == 0);
	assertTrue("host should have 0 client", testApp.getParent().getClients().size() == 0);

	//client.disconnect();
	Red5.setConnectionLocal(null);
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:37,代碼來源:ScopeTest.java

示例4: setClientRegistry

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
/**
 * Setter for client registry
 * 
 * @param clientRegistry
 *            Client registry
 */
public void setClientRegistry(IClientRegistry clientRegistry) {
    this.clientRegistry = clientRegistry;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:10,代碼來源:Context.java

示例5: getClientRegistry

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
/**
 * Return client registry
 * 
 * @return Client registry
 */
public IClientRegistry getClientRegistry() {
    return clientRegistry;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:9,代碼來源:Context.java

示例6: setClientRegistry

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
/**
 * Setter for client registry
 * 
 * @param clientRegistry Client registry
 */
public void setClientRegistry(IClientRegistry clientRegistry) {
	this.clientRegistry = clientRegistry;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:9,代碼來源:Context.java

示例7: getClientRegistry

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
/**
 * Return client registry
 * 
 * @return Client registry
 */
public IClientRegistry getClientRegistry() {
	return clientRegistry;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:9,代碼來源:Context.java

示例8: getClientRegistry

import org.red5.server.api.IClientRegistry; //導入依賴的package包/類
public IClientRegistry getClientRegistry(); 
開發者ID:Red5,項目名稱:red5-server,代碼行數:2,代碼來源:ContextMXBean.java


注:本文中的org.red5.server.api.IClientRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。