Package org.red5.server.api.scope

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


      // 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

    @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

    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

*/
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

   */
  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

     * 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

    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

      if (stream.getStreamListeners() != null) {
       
        for (Iterator<IStreamListener> iter = stream.getStreamListeners().iterator();iter.hasNext();) {
         
          IStreamListener iStreamListener = iter.next();
         
          ListenerAdapter listenerAdapter = (ListenerAdapter) iStreamListener;
         
          log.debug("Stream Closing ?? "+listenerAdapter.getFlvRecordingMetaDataId()+ " " +flvRecordingMetaDataId);
         
View Full Code Here

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
View Full Code Here

TOP

Related Classes of org.red5.server.api.scope.IScopeHandler

Copyright © 2018 www.massapicom. 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.