Examples of PendingCall


Examples of org.red5.server.service.PendingCall

  /** {@inheritDoc} */
    @Override
  public void connectionOpened(RTMPConnection conn, RTMP state) {
    // Send "connect" call to the server
    Channel channel = conn.getChannel((byte) 3);
    PendingCall pendingCall = new PendingCall("connect");
    Invoke invoke = new Invoke(pendingCall);
    invoke.setConnectionParams(connectionParams);
    invoke.setInvokeId(conn.getInvokeId());
    if (connectCallback != null)
      pendingCall.registerCallback(connectCallback);
    conn.registerPendingCall(invoke.getInvokeId(), pendingCall);
    channel.write(invoke);
  }
View Full Code Here

Examples of org.red5.server.service.PendingCall

    public void sendStatus(Status status) {
    final boolean andReturn = !status.getCode().equals(
        StatusCodes.NS_DATA_START);
    final Invoke invoke;
    if (andReturn) {
      final PendingCall call = new PendingCall(null, "onStatus",
          new Object[] { status });
      invoke = new Invoke();
      invoke.setInvokeId(1);
      invoke.setCall(call);
    } else {
View Full Code Here

Examples of org.red5.server.service.PendingCall

        dotIndex);
    String serviceMethod = (dotIndex == -1) ? action : action.substring(
        dotIndex + 1, action.length());

    if (notify instanceof Invoke) {
      PendingCall call = new PendingCall(serviceName, serviceMethod,
          params);
      ((Invoke) notify).setCall(call);
    } else {
      Call call = new Call(serviceName, serviceMethod, params);
      notify.setCall(call);
View Full Code Here

Examples of org.red5.server.service.PendingCall

    String serviceName = (dotIndex == -1) ? null : action.substring(0,
        dotIndex);
    String serviceMethod = (dotIndex == -1) ? action : action.substring(
        dotIndex + 1, action.length());

    PendingCall call = new PendingCall(serviceName, serviceMethod, params);
    msg.setCall(call);
    return msg;
  }
View Full Code Here

Examples of org.red5.server.service.PendingCall

      log.error("Endpoint " + msg.destination + " doesn't exist (" + msg + ")");
      return returnError(msg, "Server.Invoke.Error", "Endpoint " + msg.destination + " doesn't exist.", "Endpoint " + msg.destination + " doesn't exist.");
    }
   
    Object[] args = (Object[]) ConversionUtils.convert(msg.body, Object[].class);
    IPendingServiceCall call = new PendingCall(msg.operation, args);
    try {
      if (!serviceInvoker.invoke(call, endpoint)) {
        if (call.getException() != null) {
          // Use regular exception handling
          Throwable err = call.getException();
          return returnError(msg, "Server.Invoke.Error", err.getMessage(), err);
        }
        return returnError(msg, "Server.Invoke.Error", "Can't invoke method.", "");
      }
    } catch (Throwable err) {
      log.error("Error while invoking method.", err);
      return returnError(msg, "Server.Invoke.Error", err.getMessage(), err);
    }
   
    // We got a valid result from the method call.
    AcknowledgeMessage result = new AcknowledgeMessage();
    result.body = call.getResult();
    result.headers = msg.headers;
    result.clientId = msg.clientId;
    result.correlationId = msg.messageId;
    return result;
  }
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.