Package org.openengsb.core.api.remote

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


                return new AbstractFilterChainElement<byte[], byte[]>() {
                    private FilterAction next;

                    @Override
                    protected byte[] doFilter(byte[] input, Map<String, Object> metaData) {
                        MethodCallMessage deserialize;

                        try {
                            deserialize = (MethodCallMessage) SerializationUtils.deserialize(input);
                        } catch (SerializationException e) {
                            throw new FilterException(e);
View Full Code Here


    @Override
    public void onMessage(Message message) {
        LOGGER.info("recieved JMS-message");
        TextMessage content = (TextMessage) message;
        String text = getTextFromMessage(content);
        MethodCallMessage request;
        try {
            request = MAPPER.readValue(text, MethodCallMessage.class);
        } catch (IOException e1) {
            throw Throwables.propagate(e1);
        }
        MethodResult result = requestHandler.process(request.getMethodCall());
        try {
            sendResult(request, result);
        } catch (JMSException e) {
            throw Throwables.propagate(e);
        }
View Full Code Here

    private ObjectMapper mapper = new ObjectMapper();

    @Override
    protected String doFilter(String input, Map<String, Object> metaData) {
        MethodCallMessage request;
        try {
            LOGGER.trace("attempt to read SecureRequest from inputData");
            request = mapper.readValue(input, MethodCallMessage.class);
        } catch (IOException e) {
            throw new FilterException(e);
        }
        String callId = request.getCallId();
        LOGGER.info("extracted callId \"{}\" from message", callId);
        metaData.put("callId", callId);
        LOGGER.debug("converting arguments of inputmessage");
        JsonUtils.convertAllArgs(request);
        LOGGER.debug("invoking next filter: {}", next.getClass().getName());
View Full Code Here

    private FilterAction next;

    @Override
    public String doFilter(String input, Map<String, Object> metadata) throws FilterException {
        ObjectMapper objectMapper = JsonUtils.createObjectMapperWithIntroSpectors();
        MethodCallMessage callMessage;
        try {
            callMessage = objectMapper.readValue(input, MethodCallMessage.class);
            MethodCall call = callMessage.getMethodCall();
            Object[] args = call.getArgs();
            for (int i = 0; i < args.length; i++) {
                String className = call.getClasses().get(i);
                Class<?> parameterClass;
                try {
View Full Code Here

    private final ExecutorService executor = Executors.newCachedThreadPool();

    @Override
    public void sendMethodCall(String portId, String destination, MethodCall call) {
        OutgoingPort port = getPort(portId);
        MethodCallMessage request = new MethodCallMessage(call, false);
        request.setDestination(destination);
        Runnable callHandler = new SendMethodCallTask(port, request);
        executor.execute(callHandler);
    }
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

        String connectorId = "example-remote";
        MethodCall methodCall = new MethodCall("createWithId", new Object[]{ connectorId, connectorDescription });
        Map<String, String> metaData = new HashMap<String, String>();
        metaData.put("serviceId", "connectorManager");
        methodCall.setMetaData(metaData);
        MethodCallMessage methodCallRequest = new MethodCallMessage(methodCall, false);
        BeanDescription auth = BeanDescription.fromObject(new Password("password"));
        methodCallRequest.setPrincipal("admin");
        methodCallRequest.setCredentials(auth);

        ObjectMapper mapper = new ObjectMapper();
        return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(methodCallRequest);
    }
View Full Code Here

        String connectorId = "example-remote";
        MethodCall methodCall = new MethodCall("delete", new Object[]{ connectorId });
        Map<String, String> metaData = new HashMap<String, String>();
        metaData.put("serviceId", "connectorManager");
        methodCall.setMetaData(metaData);
        MethodCallMessage methodCallRequest = new MethodCallMessage(methodCall, false);
        BeanDescription auth = BeanDescription.fromObject(new Password("password"));
        methodCallRequest.setPrincipal("admin");
        methodCallRequest.setCredentials(auth);
        ObjectMapper mapper = new ObjectMapper();
        String writeValueAsString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(methodCallRequest);
        System.out.println(writeValueAsString);
    }
View Full Code Here

        MethodCall methodCall = new MethodCall("registerConnector", new String[]{ "example-remote", "jms-json",
            "tcp://127.0.0.1:%s?example-remote" });
        Map<String, String> metaData = new HashMap<String, String>();
        metaData.put("serviceId", "connectorManager");
        methodCall.setMetaData(metaData);
        MethodCallMessage methodCallRequest = new MethodCallMessage(methodCall, false);
        BeanDescription auth = BeanDescription.fromObject(new Password("password"));
        methodCallRequest.setPrincipal("admin");
        methodCallRequest.setCredentials(auth);

        ObjectMapper mapper = new ObjectMapper();
        String writeValueAsString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(methodCallRequest);
        System.out.println(writeValueAsString);
    }
View Full Code Here

TOP

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

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.