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


Java Scope类代码示例

本文整理汇总了Java中org.red5.server.scope.Scope的典型用法代码示例。如果您正苦于以下问题:Java Scope类的具体用法?Java Scope怎么用?Java Scope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: unregisterBroadcastStream

import org.red5.server.scope.Scope; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean unregisterBroadcastStream(IScope scope, String name, IBroadcastStream bs) {
    if (log.isDebugEnabled()) {
        log.debug("Unregistering - name: {} stream: {} scope: {}", new Object[] { name, bs, scope });
        ((Scope) scope).dump();
    }
    IBroadcastScope broadcastScope = scope.getBroadcastScope(name);
    if (bs != null) {
        log.debug("Unsubscribing scope {} from provider {}", broadcastScope, bs.getProvider());
        broadcastScope.unsubscribe(bs.getProvider());
        // if the scope has no listeners try to remove it
        if (!((BasicScope) broadcastScope).hasEventListeners()) {
            if (log.isDebugEnabled()) {
                log.debug("Scope has no event listeners attempting removal");
            }
            scope.removeChildScope(broadcastScope);
        }            
    } else {
        log.debug("Broadcast scope was null for {}", name);
    }
    // verify that scope was removed
    return scope.getBasicScope(ScopeType.BROADCAST, name) == null;
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:24,代码来源:ProviderService.java

示例2: unregisterBroadcastStream

import org.red5.server.scope.Scope; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean unregisterBroadcastStream(IScope scope, String name, IBroadcastStream bs) {
	log.debug("Unregistering - name: {} stream: {} scope: {}", new Object[] { name, bs, scope });
	if (log.isTraceEnabled()) {
		((Scope) scope).dump();
	}
	IBroadcastScope broadcastScope = scope.getBroadcastScope(name);
	if (bs != null) {
		log.debug("Unsubscribing scope {} from provider {}", broadcastScope, bs.getProvider());
		broadcastScope.unsubscribe(bs.getProvider());
	}
	// if the scope has no listeners try to remove it
	if (!((BasicScope) broadcastScope).hasEventListeners()) {
		log.debug("Scope has no event listeners attempting removal");
		scope.removeChildScope(broadcastScope);
	}
	// verify that scope was removed
	return scope.getBasicScope(ScopeType.BROADCAST, name) == null;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:20,代码来源:ProviderService.java

示例3: onSetUp

import org.red5.server.scope.Scope; //导入依赖的package包/类
@Override
protected void onSetUp() throws Exception {
	System.out.println("onSetUp");
	super.onSetUp();
	//
	System.setProperty("red5.deployment.type", "junit");
	if (pss == null) {
		pss = (PlaylistSubscriberStream) applicationContext.getBean("playlistSubscriberStream");
		Context ctx = new Context();
		ctx.setApplicationContext(applicationContext);
		Scope scope = new DummyScope();
		scope.setName("");
		scope.setContext(ctx);
		pss.setScope(scope);
		//
		ISchedulingService schedulingService = (ISchedulingService) applicationContext.getBean(ISchedulingService.BEAN_NAME);
		IConsumerService consumerService = (IConsumerService) applicationContext.getBean(IConsumerService.KEY);
		IProviderService providerService = (IProviderService) applicationContext.getBean(IProviderService.BEAN_NAME);
		//create and get the engine
		PlayEngine engine = pss.createEngine(schedulingService, consumerService, providerService);
		//mock the message output
		engine.setMessageOut(new DummyMessageOut());
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:25,代码来源:PlaylistSubscriberStreamTest.java

示例4: connect

import org.red5.server.scope.Scope; //导入依赖的package包/类
/**
 * Connect to another scope on server with given parameters
 * 
 * @param newScope
 *            New scope
 * @param params
 *            Parameters to connect with
 * @return true on success, false otherwise
 */
public boolean connect(IScope newScope, Object[] params) {
    if (log.isDebugEnabled()) {
        log.debug("Connect Params: {}", params);
        if (params != null) {
            for (Object e : params) {
                log.debug("Param: {}", e);
            }
        }
    }
    scope = (Scope) newScope;
    return scope.connect(this, params);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:22,代码来源:BaseConnection.java

示例5: createConnection

import org.red5.server.scope.Scope; //导入依赖的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

示例6: DummyScope

import org.red5.server.scope.Scope; //导入依赖的package包/类
DummyScope() {
	super(new Scope.Builder(null, ScopeType.ROOM, "dummy", false));
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:4,代码来源:PlaylistSubscriberStreamTest.java

示例7: setUp

import org.red5.server.scope.Scope; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	IScope scope = new Scope.Builder((IScope) new GlobalScope(), ScopeType.APPLICATION, "testapp", false).build();
	serverStream = StreamUtils.createServerStream(scope, "test");
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:6,代码来源:ServerStreamTest.java

示例8: setScope

import org.red5.server.scope.Scope; //导入依赖的package包/类
public void setScope(Scope scope) {
	this.scope = scope;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:4,代码来源:TestConnection.java


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