Package com.google.gwt.http.client

Examples of com.google.gwt.http.client.Request$RequestImpl


      RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, "/deployments/" + createdProjectName + "/");
      builder.setHeader("Content-type", "application/x-www-form-urlencoded");
      //builder.setHeader(header, value);
     
      try {
        Request request = builder.sendRequest(formBuilder.toString(), new RequestCallback() {
          public void onError(Request request, Throwable exception) {
            ErrorPanel ep = new ErrorPanel(clientFactory);
          ep.errorHTML.setHTML("<p>Error Occured</p>");
          deployerDeckPanel.add(ep);
          deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep));
View Full Code Here


       
      RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, loginURL);
      builder.setHeader("Content-type", "application/x-www-form-urlencoded");
     
      try {
        Request request = builder.sendRequest(formBuilder.toString(), new RequestCallback() {
          public void onError(Request request, Throwable exception) {
            Window.alert(exception.getMessage());
          }

          public void onResponseReceived(Request request, Response response) {
View Full Code Here

    // Using gQuery to set credentials since this method was added in 2.5.1
    // xmlHttpRequest.setWithCredentials(true);
    JsUtils.prop(xmlHttpRequest, "withCredentials", settings.getWithCredentials());

    final Request request = createRequestVltr(xmlHttpRequest, settings.getTimeout(), this);

    xmlHttpRequest.setOnReadyStateChange(new ReadyStateChangeHandler() {
      public void onReadyStateChange(XMLHttpRequest xhr) {
        if (xhr.getReadyState() == XMLHttpRequest.DONE) {
          xhr.clearOnReadyStateChange();
View Full Code Here

    } else {
      ret = GQ.getAjaxTransport().getXhr(settings)
        .then(new Function() {
          public Object f(Object...args) {
            Response response = arguments(0);
            Request request = arguments(1);
            Object retData = response.getText();
            if (retData != null && !"".equals(retData)) {
              try {
                if ("xml".equalsIgnoreCase(dataType)) {
                  retData = JsUtils.parseXML(response.getText());
                } else if ("json".equalsIgnoreCase(dataType)) {
                  retData = GQ.create(response.getText());
                } else {
                  retData = response.getText();
                  if ("script".equalsIgnoreCase(dataType)) {
                    ScriptInjector.fromString((String)retData).setWindow(window).inject();
                  }
                }
              } catch (Exception e) {
                if (GWT.isClient() && GWT.getUncaughtExceptionHandler() != null) {
                  GWT.getUncaughtExceptionHandler().onUncaughtException(e);
                } else {
                  e.printStackTrace();
                }
              }
            }
            return new Object[]{retData, "success", request, response};
          }
        }, new Function() {
          public Object f(Object...args) {
            Throwable exception = arguments(0);
            Request request = getArgument(1, Request.class);
            String msg = String.valueOf(exception);
            return new Object[]{null, msg, request, null, exception};
          }
        });
    }
View Full Code Here

      txActive = false;
    }
  }

  public void performPoll() {
    Request request = null;
    try {
      final List<Message> toSend;
      if (heldMessages.isEmpty()) {
        toSend = Collections.emptyList();
      }
View Full Code Here

    final RxInfo rxInfo = new RxInfo(System.currentTimeMillis(), waitChannel);

    try {
      // LogUtil.log("[bus] TX: " + payload);
      final Request request = builder.sendRequest(payload, new RequestCallback() {
        @Override
        public void onResponseReceived(final Request request, final Response response) {
          if (!waitChannel) {
            measuredLatency = (int) (System.currentTimeMillis() - latencyTime);
          }
View Full Code Here


        ExampleService service = GWT.create(ExampleService.class);
        ((RestServiceProxy) service).setResource(resource);

        Request request = service.getExampleDtoCancelable(new MethodCallback<ExampleDto>() {

            @Override
            public void onSuccess(Method method, ExampleDto response) {
                fail();
            }

            @Override
            public void onFailure(Method method, Throwable exception) {
                fail();
            }
        });

        request.cancel();
       
        // wait... we are in async testing...
        delayTestFinish(10000);
    }
View Full Code Here

        if(trackInvocations)
        {
            metrics.addInvocation(operation);
        }

        Request requestHandle = executeRequest(resultCallback, operation);

        return new DispatchRequestHandle(requestHandle);
    }
View Full Code Here

        return new DispatchRequestHandle(requestHandle);
    }

    private Request executeRequest(final AsyncCallback<DMRResponse> resultCallback, final ModelNode operation) {
        Request requestHandle = null;
        try {
            requestHandle = requestBuilder.sendRequest(operation.toBase64String(), new RequestCallback() {
                @Override
                public void onResponseReceived(Request request, Response response) {
View Full Code Here

                    decomposeAndLog(operation);
                }
            });
        }

        Request request = executeRequest(resultCallback, GWT.isScript() ? operation : runAsRole(operation));
        return new DispatchRequestHandle(request);
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.http.client.Request$RequestImpl

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.