Package org.red5.server.api

Examples of org.red5.server.api.IContext


   * @return <code>true</code> if the call was performed, otherwise
   *         <code>false</code>
   */
  private boolean invokeCall(RTMPConnection conn, IServiceCall call, Object service) {
    final IScope scope = conn.getScope();
    final IContext context = scope.getContext();
    if (log.isTraceEnabled()) {
      log.trace("Scope: {} context: {} service: {}", scope, context, service);
    }
    return context.getServiceInvoker().invoke(call, service);
  }
View Full Code Here


        try {
          // Lookup server scope when connected using host and application name
          IGlobalScope global = server.lookupGlobal(host, path);
          log.trace("Global lookup result: {}", global);
          if (global != null) {
            final IContext context = global.getContext();
            IScope scope = null;
            try {
              // TODO optimize this to use Scope instead of Context
              scope = context.resolveScope(global, path);
              // if global scope connection is not allowed, reject
              if (scope.getDepth() < 1 && !globalScopeConnectionAllowed) {
                call.setStatus(Call.STATUS_ACCESS_DENIED);
                if (call instanceof IPendingServiceCall) {
                  IPendingServiceCall pc = (IPendingServiceCall) call;
View Full Code Here

   * @param conn         Connection to invoke method on
   * @param call         Service call context
   * @return             true on success
   */
  public boolean serviceCall(IConnection conn, IServiceCall call) {
    final IContext context = conn.getScope().getContext();
    if (call.getServiceName() != null) {
      context.getServiceInvoker().invoke(call, context);
    } else {
      context.getServiceInvoker().invoke(call, conn.getScope().getHandler());
    }
    return true;
  }
View Full Code Here

              msgIn = null;
            }
      int type = (int) (item.getStart() / 1000);
      // see if it's a published stream
      IScope thisScope = getScope();
      IContext context = thisScope.getContext();
      IProviderService providerService = (IProviderService) context
          .getBean(IProviderService.BEAN_NAME);
            // Get live input
            IMessageInput liveInput = providerService.getLiveProviderInput(
          thisScope, item.getName(), false);
            // Get VOD input
View Full Code Here

    }

    IClientBroadcastStream bs = (IClientBroadcastStream) stream;
    try {
      bs.setPublishedName(name);
      IContext context = conn.getScope().getContext();
      IProviderService providerService = (IProviderService) context
          .getBean(IProviderService.BEAN_NAME);
      // TODO handle registration failure
      if (providerService.registerBroadcastStream(conn.getScope(),
          name, bs)) {
        bsScope = getBroadcastScope(conn.getScope(), name);
View Full Code Here

        log.error("Packet should not be null");
        return;
      }
      // Provide a valid IConnection in the Red5 object
      final IGlobalScope global = getGlobalScope(req);
      final IContext context = global.getContext();
      final IScope scope = context.resolveScope(global, packet.getScopePath());
      IRemotingConnection conn = new RemotingConnection(req, scope, packet);
      // Make sure the connection object isn't garbage collected
      req.setAttribute(CONNECTION, conn);
      try {
        Red5.setConnectionLocal(conn);
View Full Code Here

   * Getter for video codec factory.
   *
   * @return Video codec factory
   */
  public VideoCodecFactory getVideoCodecFactory() {
    final IContext context = scope.getContext();
    ApplicationContext appCtx = context.getApplicationContext();
    if (!appCtx.containsBean(VIDEO_CODEC_FACTORY)) {
      return null;
    }

    return (VideoCodecFactory) appCtx.getBean(VIDEO_CODEC_FACTORY);
View Full Code Here

        // XXX: What do do here? Return an error?
        return;
      }
    }

    final IContext context = scope.getContext();
    log.debug("Context: {}", context);
    context.getServiceInvoker().invoke(call, scope);
  }
View Full Code Here

   *         <code>false</code>
   */
  private boolean invokeCall(RTMPConnection conn, IServiceCall call,
      Object service) {
    final IScope scope = conn.getScope();
    final IContext context = scope.getContext();
    log.debug("Scope: {}", scope);
    log.debug("Service: {}", service);
    log.debug("Context: {}", context);
    return context.getServiceInvoker().invoke(call, service);
  }
View Full Code Here

                ((IPendingServiceCall) call).setResult(status);
              }
              log.info("No application scope found for {} on host {}. Misspelled or missing application folder?", path, host);
              disconnectOnReturn = true;
            } else {
              final IContext context = global.getContext();
              IScope scope = null;
              try {
                scope = context.resolveScope(global, path);
              } catch (ScopeNotFoundException err) {
                call.setStatus(Call.STATUS_SERVICE_NOT_FOUND);
                if (call instanceof IPendingServiceCall) {
                  StatusObject status = getStatus(NC_CONNECT_REJECTED);
                  status.setDescription("No scope \"" + path
View Full Code Here

TOP

Related Classes of org.red5.server.api.IContext

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.