Examples of IScopeHandler


Examples of org.red5.server.api.IScopeHandler

    }
   
    final Set<IConnection> conns = clients.get(client);
    if (conns != null) {
      conns.remove(conn);
      IScopeHandler handler = null;
      if (hasHandler()) {
        handler = getHandler();
        try {
          handler.disconnect(conn, this);
        } catch (Exception e) {
          log.error("Error while executing \"disconnect\" for connection {} on handler {}. {}", new Object[]{conn, handler, e});
        }
      }
      if (conns.isEmpty()) {
        clients.remove(client);
        clientStats.decrement();
        if (handler != null) {
          try {
            // there may be a timeout here ?
            handler.leave(client, this);
          } catch (Exception e) {
            log.error("Error while executing \"leave\" for client {} on handler {}. {}", new Object[]{conn, handler, e});
          }
        }
      }
View Full Code Here

Examples of org.red5.server.api.IScopeHandler

*/
public class HandlerServiceResolver implements IServiceResolver {

  /** {@inheritDoc} */
    public Object resolveService(IScope scope, String serviceName) {
    IScopeHandler handler = scope.getHandler();
    if (handler instanceof IServiceHandlerProvider) {
      // TODO: deprecate this?
      Object result = ((IServiceHandlerProvider) handler)
          .getServiceHandler(serviceName);
      if (result != null) {
View Full Code Here

Examples of org.red5.server.api.IScopeHandler

     * Return stream aware scope handler or null if scope is null
     * @return      IStreamAwareScopeHandler implementation
     */
  protected IStreamAwareScopeHandler getStreamAwareHandler() {
    if (scope != null) {
      IScopeHandler handler = scope.getHandler();
      if (handler instanceof IStreamAwareScopeHandler) {
        return (IStreamAwareScopeHandler) handler;
      }
    }
    return null;
View Full Code Here

Examples of org.red5.server.api.IScopeHandler

   * @param call  Service call
   */
  protected void invokeCall(RTMPConnection conn, IServiceCall call) {
    final IScope scope = conn.getScope();
    if (scope.hasHandler()) {
      final IScopeHandler handler = scope.getHandler();
      log.debug("Scope: {}", scope);
      log.debug("Handler: {}", handler);
      if (!handler.serviceCall(conn, call)) {
        // XXX: What do do here? Return an error?
        return;
      }
    }

View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

      }
      return;
    }
    // remove it if it exists
    if (clients.remove(client)) {
      IScopeHandler handler = getHandler();
      if (handler != null) {
        try {
          handler.disconnect(conn, this);
        } catch (Exception e) {
          log.error("Error while executing \"disconnect\" for connection {} on handler {}. {}", new Object[] { conn, handler, e });
        }
        try {
          // there may be a timeout here ?
          handler.leave(client, this);
        } catch (Exception e) {
          log.error("Error while executing \"leave\" for client {} on handler {}. {}", new Object[] { conn, handler, e });
        }
      }
      // remove listener
View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

      // check #1
      if (!containsKey(scope)) {
        log.debug("Adding child scope: {} to {}", (((IBasicScope) scope).getName()), this);
        if (hasHandler()) {
          // get the handler for the scope to which we are adding this new scope
          IScopeHandler hdlr = getHandler();
          // add the scope to the handler
          if (!hdlr.addChildScope(scope)) {
            log.warn("Failed to add child scope: {} to {}", scope, this);
            return false;
          }
        } else {
          log.debug("No handler found for {}", this);
View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

    @Override
    public Boolean remove(Object scope) {
      log.debug("Remove child scope: {}", scope);
      //log.trace("remove - Hold counts - read: {} write: {} queued: {}", internalLock.getReadHoldCount(), internalLock.getWriteHoldCount(), internalLock.hasQueuedThreads());     
      if (hasHandler()) {
        IScopeHandler hdlr = getHandler();
        log.debug("Removing child scope: {}", (((IBasicScope) scope).getName()));
        hdlr.removeChildScope((IBasicScope) scope);
        if (scope instanceof Scope) {
          // cast it
          Scope scp = (Scope) scope;
          // stop the scope
          scp.stop();
View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

    Object handler = null;
    if (checkHandler) {
      IScope current = scope;
      while (current != null) {
        IScopeHandler scopeHandler = current.getHandler();
        if (intf.isInstance(scopeHandler)) {
          handler = scopeHandler;
          break;
        }
        if (!current.hasParent()) {
View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

*/
public class HandlerServiceResolver implements IServiceResolver {

  /** {@inheritDoc} */
  public Object resolveService(IScope scope, String serviceName) {
    IScopeHandler handler = scope.getHandler();
    if (handler instanceof IServiceHandlerProvider) {
      // TODO: deprecate this?
      Object result = ((IServiceHandlerProvider) handler).getServiceHandler(serviceName);
      if (result != null) {
        return result;
View Full Code Here

Examples of org.red5.server.api.scope.IScopeHandler

   */
  protected void invokeCall(RTMPConnection conn, IServiceCall call) {
    final IScope scope = conn.getScope();
    if (scope != null) {
        if (scope.hasHandler()) {
          final IScopeHandler handler = scope.getHandler();
          log.debug("Scope: {} handler: {}", scope, handler);
          if (!handler.serviceCall(conn, call)) {
            // XXX: What to do here? Return an error?
            log.warn("Scope: {} handler failed on service call", scope.getName(), new Exception("Service call failed"));
            return;
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.