Package com.kurento.kmf.jsonrpcconnector

Examples of com.kurento.kmf.jsonrpcconnector.Props


    String methodName = method.getName();

    if (method.getAnnotation(FactoryMethod.class) != null) {

      Props props = ParamAnnotationUtils.extractProps(
          method.getParameterAnnotations(), args);

      return createBuilderObject(proxy, method, methodName, props);

    } else if (methodName.equals("release")) {
View Full Code Here


    }
  }

  private Object invoke(Method method, Object[] args, Continuation<?> cont) {

    Props props = ParamAnnotationUtils.extractProps(
        method.getParameterAnnotations(), args);

    if (cont != null) {

      Type[] paramTypes = method.getGenericParameterTypes();
View Full Code Here

  private Object createBuilderObject(final Object proxy, Method method,
      String methodName, Props props) {

    if (props == null) {
      props = new Props();
    }

    FactoryMethod annotation = method.getAnnotation(FactoryMethod.class);
    props.add(annotation.value(), remoteObject.getObjectRef());
View Full Code Here

    jsonObject.addProperty("prop1", "XXX");
    jsonObject.addProperty("prop2", 33);
    jsonObject.addProperty("prop3", "YYY");
    jsonObject.addProperty("prop4", 5.5f);

    Props props = JsonUtils.fromJson(jsonObject, Props.class);

    assertEquals(props.getProp("prop1"), "XXX");
    assertEquals(props.getProp("prop2"), 33);
    assertEquals(props.getProp("prop3"), "YYY");
    assertEquals(props.getProp("prop4"), 5.5f);
  }
View Full Code Here

  }

  @Test
  public void jsonToPropsConversion() {

    Props param = new Props();
    param.add("prop1", "XXX");
    param.add("prop2", 33);
    param.add("prop3", "YYY");
    param.add("prop4", 5.5f);

    JsonObject jsonObject = JsonUtils.toJsonObject(param);

    assertEquals(jsonObject.get("prop1").getAsString(), "XXX");
    assertEquals(jsonObject.get("prop2").getAsInt(), 33);
View Full Code Here

  @Override
  public Object internalInvoke(Object proxy, Method method, Object[] args)
      throws Throwable {

    Props props = ParamAnnotationUtils.extractProps(
        method.getParameterAnnotations(), args);

    return Proxy.newProxyInstance(proxy.getClass().getClassLoader(),
        new Class[] { method.getReturnType() },
        new BuilderInvocationHandler(clazz, props, factory));
View Full Code Here

    JsonObject params = new JsonObject();
    params.addProperty(CREATE_TYPE, remoteClassName);
    if (constructorParams != null) {

      Props flatParams = ParamsFlattener.getInstance().flattenParams(
          constructorParams);

      params.add(CREATE_CONSTRUCTOR_PARAMS,
          JsonUtils.toJsonObject(flatParams));
    }
View Full Code Here

    params.addProperty(INVOKE_OBJECT, objectRef);
    params.addProperty(INVOKE_OPERATION_NAME, operationName);

    if (operationParams != null) {

      Props flatParams = ParamsFlattener.getInstance().flattenParams(
          operationParams);

      params.add(INVOKE_OPERATION_PARAMS,
          JsonUtils.toJsonObject(flatParams));
    }
View Full Code Here

  }

  @Override
  public void release(String objectRef, Continuation<Void> cont) {

    JsonObject params = JsonUtils.toJsonObject(new Props(RELEASE_OBJECT,
        objectRef));

    sendRequest(RELEASE_METHOD, Void.class, params, null, cont);
  }
View Full Code Here

  @Override
  public String subscribe(String objectRef, String eventType,
      Continuation<String> cont) {

    JsonObject params = JsonUtils.toJsonObject(new Props(SUBSCRIBE_OBJECT,
        objectRef).add(SUBSCRIBE_TYPE, eventType));

    Function<JsonElement, String> processor = new Function<JsonElement, String>() {
      @Override
      public String apply(JsonElement subscription) {
View Full Code Here

TOP

Related Classes of com.kurento.kmf.jsonrpcconnector.Props

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.