Package org.red5.server.service

Examples of org.red5.server.service.PendingCall


    invoke(method, null, callback);
  }

  /** {@inheritDoc} */
  public void invoke(String method, Object[] params, IPendingServiceCallback callback) {
    IPendingServiceCall call = new PendingCall(method, params);
    if (callback != null) {
      call.registerCallback(callback);
    }
    invoke(call);
  }
View Full Code Here


      String serviceMethod = (dotIndex == -1) ? action : action.substring(dotIndex + 1, action.length());
      // pull off the prefixes since java doesn't allow this on a method name
      if (serviceMethod.startsWith("@") || serviceMethod.startsWith("|")) {
        serviceMethod = serviceMethod.substring(1);
      }
      PendingCall call = new PendingCall(serviceName, serviceMethod, params);
      invoke.setCall(call);
      return invoke;
    } else {
      //TODO replace this with something better as time permits
      throw new RuntimeException("Action was null");
View Full Code Here

    }
    final int dotIndex = action.lastIndexOf('.');
    String serviceName = (dotIndex == -1) ? null : action.substring(0, dotIndex);
    String serviceMethod = (dotIndex == -1) ? action : action.substring(dotIndex + 1, action.length());
    log.debug("Service name: {} method: {}", serviceName, serviceMethod);
    PendingCall call = new PendingCall(serviceName, serviceMethod, params);
    msg.setCall(call);
    return msg;
  }
View Full Code Here

  @Test
  public void simpletest() {
    if (context.hasBean("echoService")) {
        EchoService service = (EchoService) context.getBean("echoService");
        IPendingServiceCall call = new PendingCall("echoService", "echoString",
            new Object[] { "My String" });
        context.getServiceInvoker().invoke(call, service);
        assertTrue("result null", call.getResult() != null);
    } else {
      System.out.println("No echo service found");
      assertTrue(false);
    }
  }
View Full Code Here

  @Override
  public void invoke(String name, Object[] params, IPendingServiceCallback callback) {
    if ("echo".equals(name)) {
      echo(params);
    }   
    IPendingServiceCall call = new PendingCall(null, name, params);
    call.setResult(Boolean.TRUE);
    callback.resultReceived(call);
  }
View Full Code Here

  }

  /** {@inheritDoc} */
  public void invoke(String method, Object[] params,
      IPendingServiceCallback callback) {
    IPendingServiceCall call = new PendingCall(method, params);
    if (callback != null) {
      call.registerCallback(callback);
    }
    invoke(call);
  }
View Full Code Here

    params.put("fpad", false);
    params.put("audioCodecs",(double)615);
    params.put("videoCodecs",(double)76);
    params.put("pageUrl","http://localhost/test.html");
    params.put("objectEncoding",(double)0);
    PendingCall pendingCall=new PendingCall("connect");
    Invoke invoke=new Invoke(pendingCall);
    invoke.setConnectionParams(params);
    invoke.setInvokeId(1);
    channel.write(invoke);
  }
View Full Code Here

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

    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

        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

TOP

Related Classes of org.red5.server.service.PendingCall

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.