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


Java IServer類代碼示例

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


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

示例1: add

import org.red5.server.api.IServer; //導入依賴的package包/類
public boolean add(IScope scope) {
	log.debug("Adding scope to scope set");
	if (hasHandler()) {
		// add the scope to the handler
		if (!getHandler().addChildScope(scope)) {
			log.debug("Failed to add child scope: {} to {}", scope, this);
			return false;
		}
		// start the scope
		if (!getHandler().start((IScope) scope)) {
			log.debug("Failed to start child scope: {} in {}", scope, this);
			return false;
		}
	}
	// add the entry
	@SuppressWarnings("unchecked")
	boolean added = super.add((IBasicScope) scope);
	if (added) {
		subscopeStats.increment();
		// post notification
		IServer server = getServer();
		((Server) server).notifyScopeCreated((IScope) scope);
	}
	return added;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:26,代碼來源:Scope.java

示例2: getServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Return the server instance connected to this scope.
 * 
 * @return the server instance
 */
public IServer getServer() {
    if (hasParent()) {
        final IScope parent = getParent();
        if (parent instanceof Scope) {
            return ((Scope) parent).getServer();
        } else if (parent instanceof IGlobalScope) {
            return ((IGlobalScope) parent).getServer();
        }
    }
    return null;
}
 
開發者ID:Red5,項目名稱:red5-server-common,代碼行數:17,代碼來源:Scope.java

示例3: service

import org.red5.server.api.IServer; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    log.debug("Servicing Request");
    if (codecFactory == null) {
        ServletContext ctx = getServletContext();
        log.debug("Context path: {}", ctx.getContextPath());
        //attempt to lookup the webapp context		
        webAppCtx = WebApplicationContextUtils.getRequiredWebApplicationContext(ctx);
        //now try to look it up as an attribute
        if (webAppCtx == null) {
            log.debug("Webapp context was null, trying lookup as attr.");
            webAppCtx = (WebApplicationContext) ctx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
        }
        //lookup the server and codec factory
        if (webAppCtx != null) {
            server = (IServer) webAppCtx.getBean("red5.server");
            codecFactory = (RemotingCodecFactory) webAppCtx.getBean("remotingCodecFactory");
        } else {
            log.debug("No web context");
        }
    }
    log.debug("Remoting request {} {}", req.getContextPath(), req.getServletPath());
    if (APPLICATION_AMF.equals(req.getContentType())) {
        serviceAMF(req, resp);
    } else {
        resp.getWriter().write("Red5 : Remoting Gateway");
    }
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:30,代碼來源:AMFGatewayServlet.java

示例4: getServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Return the server instance connected to this scope.
 * 
 * @return the server instance
 */
public IServer getServer() {
	if (!hasParent()) {
		return null;
	}
	final IScope parent = getParent();
	if (parent instanceof Scope) {
		return ((Scope) parent).getServer();
	} else if (parent instanceof IGlobalScope) {
		return ((IGlobalScope) parent).getServer();
	} else {
		return null;
	}
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:19,代碼來源:Scope.java

示例5: service

import org.red5.server.api.IServer; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	log.debug("Servicing Request");
	if (codecFactory == null) {
		ServletContext ctx = getServletContext();
		log.debug("Context path: {}", ctx.getContextPath());
		//attempt to lookup the webapp context		
		webAppCtx = WebApplicationContextUtils.getRequiredWebApplicationContext(ctx);
		//now try to look it up as an attribute
		if (webAppCtx == null) {
			log.debug("Webapp context was null, trying lookup as attr.");
			webAppCtx = (WebApplicationContext) ctx
					.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
		}
		//lookup the server and codec factory
		if (webAppCtx != null) {
			server = (IServer) webAppCtx.getBean("red5.server");
			codecFactory = (RemotingCodecFactory) webAppCtx.getBean("remotingCodecFactory");
		} else {
			log.debug("No web context");
		}
	}
	log.debug("Remoting request {} {}", req.getContextPath(), req.getServletPath());
	if (APPLICATION_AMF.equals(req.getContentType())) {
		serviceAMF(req, resp);
	} else {
		resp.getWriter().write("Red5 : Remoting Gateway");
	}
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:31,代碼來源:AMFGatewayServlet.java

示例6: connect

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Connect to scope with parameters. To successfully connect to scope it must have handler that will accept this connection with given set of parameters. Client associated with connection is added to scope clients set, connection is registered as scope event listener.
 * 
 * @param conn Connection object
 * @param params Parameters passed with connection
 * @return true on success, false otherwise
 */
public boolean connect(IConnection conn, Object[] params) {
    log.debug("Connect - scope: {} connection: {}", this, conn);
    if (enabled) {
        if (hasParent() && !parent.connect(conn, params)) {
            log.debug("Connection to parent failed");
            return false;
        }
        if (hasHandler() && !getHandler().connect(conn, this, params)) {
            log.debug("Connection to handler failed");
            return false;
        }
        if (!conn.isConnected()) {
            log.debug("Connection is not connected");
            // timeout while connecting client
            return false;
        }
        final IClient client = conn.getClient();
        // we would not get this far if there is no handler
        if (hasHandler() && !getHandler().join(client, this)) {
            return false;
        }
        // checking the connection again? why?
        if (!conn.isConnected()) {
            // timeout while connecting client
            return false;
        }
        // add the client and event listener
        if (clients.add(client) && addEventListener(conn)) {
            log.debug("Added client");
            // increment conn stats
            connectionStats.increment();
            // get connected scope
            IScope connScope = conn.getScope();
            log.trace("Connection scope: {}", connScope);
            if (this.equals(connScope)) {
                final IServer server = getServer();
                if (server instanceof Server) {
                    ((Server) server).notifyConnected(conn);
                }
            }
            return true;
        }
    } else {
        log.debug("Connection failed, scope is disabled");
    }
    return false;
}
 
開發者ID:Red5,項目名稱:red5-server-common,代碼行數:55,代碼來源:Scope.java

示例7: getServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public IServer getServer() {
    return server;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:6,代碼來源:GlobalScope.java

示例8: connect

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Connect to scope with parameters. To successfully connect to scope it
 * must have handler that will accept this connection with given set of
 * parameters. Client associated with connection is added to scope clients set,
 * connection is registered as scope event listener.
 * 
 * @param conn Connection object
 * @param params Parameters passed with connection
 * @return <code>true</code> on success, <code>false</code> otherwise
 */
public boolean connect(IConnection conn, Object[] params) {
	log.debug("Connect: {}", conn);
	if (hasParent() && !parent.connect(conn, params)) {
		return false;
	}
	if (hasHandler() && !getHandler().connect(conn, this, params)) {
		return false;
	}
	final IClient client = conn.getClient();
	if (!conn.isConnected()) {
		// timeout while connecting client
		return false;
	}
	// we would not get this far if there is no handler
	if (hasHandler() && !getHandler().join(client, this)) {
		return false;
	}
	// checking the connection again? why?
	if (!conn.isConnected()) {
		// Timeout while connecting client
		return false;
	}

	Set<IConnection> conns = clients.get(client);
	if (conns == null) {
		conns = new CopyOnWriteArraySet<IConnection>();
		clients.put(client, conns);
	}
	conns.add(conn);

	clientStats.increment();
	addEventListener(conn);
	connectionStats.increment();

	IScope connScope = conn.getScope();
	log.trace("Connection scope: {}", connScope);
	if (this.equals(connScope)) {
		final IServer server = getServer();
		if (server instanceof Server) {
			((Server) server).notifyConnected(conn);
		}
	}
	return true;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:55,代碼來源:Scope.java

示例9: getServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public IServer getServer() {
	return server;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:6,代碼來源:GlobalScope.java

示例10: getServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Return the server this global scope runs in.
 * 
 * @return the server
 */
public IServer getServer();
 
開發者ID:Red5,項目名稱:red5-server-common,代碼行數:7,代碼來源:IGlobalScope.java

示例11: setServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Setter for server object.
 * 
 * @param server
 *            Red5 server instance
 */
public void setServer(IServer server) {
    this.server = server;
}
 
開發者ID:Red5,項目名稱:red5-server-common,代碼行數:10,代碼來源:RTMPHandler.java

示例12: setServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Setter for server
 * 
 * @param server Server
 */
public void setServer(IServer server) {
    this.server = server;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:9,代碼來源:GlobalScope.java

示例13: setServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Setter for server
 * 
 * @param server
 *            Server instance
 */
public void setServer(IServer server) {
    log.info("Set server {}", server);
    this.server = server;
}
 
開發者ID:Red5,項目名稱:red5-server,代碼行數:11,代碼來源:WebScope.java

示例14: setServer

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

示例15: setServer

import org.red5.server.api.IServer; //導入依賴的package包/類
/**
 * Setter for server
 * 
 * @param server Server instance
 */
public void setServer(IServer server) {
	log.info("Set server {}", server);
	this.server = server;
}
 
開發者ID:cwpenhale,項目名稱:red5-mobileconsole,代碼行數:10,代碼來源:WebScope.java


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