Package com.google.gwt.http.client

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


    public void find(int id, ResourceResponseHandler handler) {
        RequestBuilder builder = buildGet(id);
        ResourceResponseCallback requestCallback = new ResourceResponseCallback(factory, handler);
        
        try {
            Request response = builder.sendRequest(null, requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
View Full Code Here


    public void findAll(CollectionResponseHandler handler) {
        RequestBuilder builder = buildGet();
        CollectionResponseCallback requestCallback = new CollectionResponseCallback(factory, handler, parser);
       
        try {
            Request response = builder.sendRequest(null, requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
View Full Code Here

    public void create(Resource resource, ResourceResponseHandler handler) {
        RequestBuilder builder = buildPost();
        ResourceResponseCallback requestCallback = new ResourceCreationResponseCallback(factory, handler);
       
        try {
            Request response = builder.sendRequest(resource.toRepresentation(), requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
       
    }
View Full Code Here

    public void update(Resource resource, StatusResponseHandler handler) {
        RequestBuilder builder = buildPut(resource.getId());
        StatusResponseCallback requestCallback = new StatusResponseCallback(handler);
       
        try {
            Request response = builder.sendRequest(resource.toRepresentation(), requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
View Full Code Here

    public void delete(int id, StatusResponseHandler handler) {
        RequestBuilder builder = buildDelete(id);
        StatusResponseCallback requestCallback = new StatusResponseCallback(handler);
       
        try {
            Request response = builder.sendRequest(null, requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
View Full Code Here

    public void doGet(String url, RequestCallback callback) {
      RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
      responseState = State.COMPLETED;

      try {
         Request response = builder.sendRequest(null, callback);
      } catch (RequestException e) {
         responseState = State.ERROR;
         errorMessage = e.getMessage();
      }
    }
View Full Code Here

        // TODO this should be configurable
        rb.setHeader("Content-Type", JsonConstants.JSON_CONTENT_TYPE);
        rb.setRequestData(payload.toString());
        rb.setCallback(requestCallback);

        final Request request = rb.send();
        if (webkitMaybeIgnoringRequests && BrowserInfo.get().isWebkit()) {
            final int retryTimeout = 250;
            new Timer() {
                @Override
                public void run() {
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

        assert action.getOperation()!=null;

        final ModelNode operation = action.getOperation();

        Request request = executeRequest(resultCallback, operation);
        DispatchRequest handle = new DispatchRequestHandle(request);

        return handle;

    }
View Full Code Here

TOP

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

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.