Package org.springframework.yarn.integration.ip.mind

Examples of org.springframework.yarn.integration.ip.mind.MindRpcMessageHolder


    try {
      String type = source.getType();
      Map<String, String> headers = new HashMap<String, String>();
      headers.put("type", type);
      byte[] content = objectMapper.writeValueAsBytes(source);
      return new MindRpcMessageHolder(headers, content);
    } catch (JsonProcessingException e) {
      throw new MindDataConversionException("Failed to convert source object.", e);
    }
  }
View Full Code Here


    ObjectMapper objectMapper = new ObjectMapper();
    MindHolderToObjectConverter holderToObject = new MindHolderToObjectConverter(objectMapper, "org.springframework.yarn.integration.ip.mind");
    MindObjectToHolderConverter objectToHolder = new MindObjectToHolderConverter(objectMapper);

    SimpleTestRequest request1 = new SimpleTestRequest();
    MindRpcMessageHolder holder = objectToHolder.convert(request1);
    assertThat(holder, notNullValue());
    SimpleTestRequest request2 = (SimpleTestRequest) holderToObject.convert(holder);
    assertThat(request2, notNullValue());
    assertThat(request1.type, is(request2.type));
    assertThat(request1.stringField, is(request2.stringField));
View Full Code Here

    ObjectMapper objectMapper = new ObjectMapper();
    MindHolderToObjectConverter holderToObject = new MindHolderToObjectConverter(objectMapper);
    MindObjectToHolderConverter objectToHolder = new MindObjectToHolderConverter(objectMapper);

    SimpleTestRequest2 request1 = new SimpleTestRequest2();
    MindRpcMessageHolder holder = objectToHolder.convert(request1);
    assertThat(holder, notNullValue());
    SimpleTestRequest2 request2 = (SimpleTestRequest2) holderToObject.convert(holder);
    assertThat(request2, notNullValue());
    assertThat(request1.type, is(request2.type));
    assertThat(request1.stringField, is(request2.stringField));
View Full Code Here

TOP

Related Classes of org.springframework.yarn.integration.ip.mind.MindRpcMessageHolder

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.