本文整理汇总了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;
}
示例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;
}
示例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());
}
}
示例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);
}
示例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;
}
示例6: DummyScope
import org.red5.server.scope.Scope; //导入依赖的package包/类
DummyScope() {
super(new Scope.Builder(null, ScopeType.ROOM, "dummy", false));
}
示例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");
}
示例8: setScope
import org.red5.server.scope.Scope; //导入依赖的package包/类
public void setScope(Scope scope) {
this.scope = scope;
}