Package org.openengsb.core.api.remote

Examples of org.openengsb.core.api.remote.MethodResultMessage


        }
        return (Document) domResult.getNode();
    }

    private MethodResultMessage parseMethodResult(Document input) throws JAXBException {
        MethodResultMessage request = unmarshaller.unmarshal(input, MethodResultMessage.class).getValue();
        MethodResult result = request.getResult();
        Class<?> resultClass;
        try {
            resultClass = Class.forName(result.getClassName());
        } catch (ClassNotFoundException e) {
            throw new FilterException(e);
View Full Code Here


    private FilterAction next;

    @Override
    public MethodResultMessage doFilter(MethodCallMessage input, Map<String, Object> metadata) throws FilterException {
        ObjectMapper objectMapper = JsonUtils.createObjectMapperWithIntroSpectors();
        MethodResultMessage resultMessage;
        try {
            String jsonString = objectMapper.writeValueAsString(input);
            String resultString = (String) next.filter(jsonString, metadata);
            if (resultString == null) {
                return null;
            }
            resultMessage = objectMapper.readValue(resultString, MethodResultMessage.class);
        } catch (IOException e) {
            throw new FilterException(e);
        }
        MethodResult result = resultMessage.getResult();
        if (result.getType().equals(ReturnType.Void)) {
            result.setArg(null);
        } else {
            Class<?> resultType;
            try {
View Full Code Here

    @Override
    protected MethodResultMessage doFilter(MethodCallMessage input, Map<String, Object> metadata) {
        metadata.put("callId", input.getCallId());
        metadata.put("answer", input.isAnswer());
        MethodResult result = requestHandler.handleCall(input.getMethodCall());
        return new MethodResultMessage(result, input.getCallId());
    }
View Full Code Here

                } catch (ClassNotFoundException e) {
                    throw new FilterException(e);
                }
                args[i] = objectMapper.convertValue(args[i], parameterClass);
            }
            MethodResultMessage returnValue = (MethodResultMessage) next.filter(callMessage, metadata);
            return objectMapper.writeValueAsString(returnValue);
        } catch (IOException e) {
            throw new FilterException(e);
        }
    }
View Full Code Here

    @Override
    public MethodResult sendMethodCallWithResult(String portId, String destination, MethodCall call) {
        OutgoingPort port = getPort(portId);
        MethodCallMessage request = new MethodCallMessage(call, true);
        request.setDestination(destination);
        MethodResultMessage requestResult = port.sendSync(request);
        return requestResult.getResult();
    }
View Full Code Here

        assertThat(model.getResult(), is("successful with tail"));
    }

    private ExampleResponseModel extractResponseModelFromMethodResult(String jsonMessage) throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        MethodResultMessage methodResult = mapper.readValue(jsonMessage, MethodResultMessage.class);
        JsonUtils.convertResult(methodResult);
        return (ExampleResponseModel) methodResult.getResult().getArg();
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.remote.MethodResultMessage

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.