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


Java IScope.getContextPath方法代码示例

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


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

示例1: makeScope

import org.red5.server.api.scope.IScope; //导入方法依赖的package包/类
/**
 * Create a web socket scope from a server IScope. Use the IWebSocketScopeListener interface to configure the created scope.
 * 
 * @param scope
 */
public void makeScope(IScope scope) {
    log.debug("makeScope: {}", scope);
    String path = scope.getContextPath();
    WebSocketScope wsScope = null;
    if (!scopes.containsKey(path)) {
        // add the name to the collection (no '/' prefix)
        activeRooms.add(scope.getName());
        // new websocket scope for the server scope
        wsScope = new WebSocketScope();
        wsScope.setPath(path);
        wsScope.setScope(scope);
        notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
        addWebSocketScope(wsScope);
        log.debug("Use the IWebSocketScopeListener interface to be notified of new scopes");
    } else {
        log.debug("Scope already exists: {}", path);
    }
}
 
开发者ID:Red5,项目名称:red5-websocket,代码行数:24,代码来源:WebSocketScopeManager.java

示例2: SharedObjectScope

import org.red5.server.api.scope.IScope; //导入方法依赖的package包/类
/**
 * Creates shared object with given parent scope, name, persistence flag state and store object
 * 
 * @param parent
 *            Parent scope
 * @param name
 *            Name
 * @param persistent
 *            Persistence flag state
 * @param store
 *            Persistence store
 */
public SharedObjectScope(IScope parent, String name, boolean persistent, IPersistenceStore store) {
    super(parent, ScopeType.SHARED_OBJECT, name, persistent);
    // create shared object wrapper around the attributes
    String path = parent.getContextPath();
    if ("".equals(path) || path.charAt(0) != '/') {
        path = '/' + path;
    }
    log.trace("Path+name: {}/{}", path, name);
    // Load SO
    so = (SharedObject) store.load(ScopeType.SHARED_OBJECT + path + '/' + name);
    // Create if it doesn't exist
    if (so == null) {
        so = new SharedObject(name, path, persistent, store);
        // Save
        store.save(so);
    } else {
        // set path
        so.setPath(path);
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:33,代码来源:SharedObjectScope.java

示例3: route

import org.red5.server.api.scope.IScope; //导入方法依赖的package包/类
/**
 * Routes a message on a given scope to the associated websocket connections.
 * 
 * @param scope
 * @param message
 */
public void route(IScope scope, String message) 
{
    // scope.path = /default scope.name = chat
    String path = scope.getContextPath();
    log.debug("Route to WebSocket: {} with {}", path, message);
    if (getSharedObject(path) == null) {
        log.warn("Shared object for path: {} did not exist", path);
    }
    if (wsListener != null) {
        wsListener.sendToAll(scope.getContextPath(), message);
    }
}
 
开发者ID:rajdeeprath,项目名称:red5-server-apps,代码行数:19,代码来源:CommLinkRouter.java


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