Examples of exchange()


Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? " + (isStopping() || isStopped()));
                        }
                        continue;
View Full Code Here

Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? {}", isStopping() || isStopped());
                        }
                        continue;
View Full Code Here

Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? " + (isStopping() || isStopped()));
                        }
                        continue;
View Full Code Here

Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? {}", isStopping() || isStopped());
                        }
                        continue;
View Full Code Here

Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? {}", isStopping() || isStopped());
                        }
                        continue;
View Full Code Here

Examples of java.util.concurrent.Exchanger.exchange()

                if (concurrent) {
                    // Pass the object to the handler thread via the exchanger.
                    // The handler will take it from there.
                    try {
                        exchanger.exchange(value);
                    } catch (InterruptedException e) {
                        if (log.isDebugEnabled()) {
                            log.debug("Interrupted, are we stopping? {}", isStopping() || isStopped());
                        }
                        continue;
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.exchange()

    logger.info("Created multipart request: " + multipartMap);
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(new MediaType("multipart", "form-data"));
    HttpEntity<Object> request = new HttpEntity<Object>(multipartMap, headers);
    logger.info("Posting request to: " + uri);
    ResponseEntity<?> httpResponse = template.exchange(uri, HttpMethod.POST, request, Object.class);
    if (!httpResponse.getStatusCode().equals(HttpStatus.OK)){
      logger.error("Problems with the request. Http status: " + httpResponse.getStatusCode());
    }
  }
}
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.exchange()

                requestHeaders.put(header, new ArrayList<>(values));
        }

        HttpEntity<byte[]> httpEntity = new HttpEntity<>(request.body(), requestHeaders);

        ResponseEntity<byte[]> responseEntity = restTemplate.exchange(request.url(), method, httpEntity, byte[].class);

        Map<String, Collection<String>> headers = new HashMap<>();

        for (String header: responseEntity.getHeaders().keySet()) {
            headers.put(header, responseEntity.getHeaders().get(header));
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.exchange()

          headers.set("Authorization", String.format("%s %s", OAuth2AccessToken.BEARER_TYPE, knownClient.getRegistrationAccessToken()));
          headers.setAccept(Lists.newArrayList(MediaType.APPLICATION_JSON));
 
          HttpEntity<String> entity = new HttpEntity<String>(headers);
 
          String registered = restTemplate.exchange(knownClient.getRegistrationClientUri(), HttpMethod.GET, entity, String.class).getBody();
          // TODO: handle HTTP errors
 
          RegisteredClient client = ClientDetailsEntityJsonProcessor.parseRegistered(registered);
 
          return client;
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.exchange()

    ResponseEntity<Response<Project>> response = null;
    HttpEntity<String> httpEntity = new HttpEntity<String>(
        objectMapper.writeValueAsString(request), headers);

    response = restTemplate.exchange(getBaseServiceUrl()
        + "/ProjectService1.svc/GetProjectDetails", HttpMethod.POST,
        httpEntity,
        new ParameterizedTypeReference<Response<Project>>() {
        });
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.