Examples of RemoteInvocation


Examples of org.springframework.remoting.support.RemoteInvocation

        }

        public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)
                throws IOException, ServletException {
            ObjectInputStream reqStream = new ObjectInputStream(request.getInputStream());
            RemoteInvocation invocation;
            try {
                invocation = (RemoteInvocation) reqStream.readObject();
            } catch (ClassNotFoundException e) {
                throw new ServletException("Failed to load invocation class: " + e.getMessage(), e);
            } finally {
                reqStream.close();
            }

            System.out.println("Invocation: " + invocation + " - args=" + Arrays.toString(invocation.getArguments()));
            assertEquals("Mismatched target value", "/" + invocation.getMethodName(), target);

            String color = request.getHeader(Color.TOKEN_NAME);
            assertFalse("No color provided", StringUtil.isEmpty(color));

            RemoteInvocationResult result = new RemoteInvocationResult(invocation);
View Full Code Here

Examples of org.springframework.remoting.support.RemoteInvocation

    }

    @Test
    public void testSuccessfulRemoteInvocation() throws Exception {
        TestInvoker invoker = new TestInvoker(Long.valueOf(System.currentTimeMillis()));
        RemoteInvocation invocation = invoker.createRemoteInvocation("testSuccessfulRemoteInvocation");
        invocation.setAttributes(Collections.singletonMap("testSuccessfulRemoteInvocation", (Serializable) Long.valueOf(System.currentTimeMillis())));

        HttpInvokerClientConfiguration config =
                createMockConfiguration(invocation.getMethodName(), "http://hello/world", "http://here/testSuccessfulRemoteInvocation");
        RemoteInvocationResult result = invoker.executeRequest(config, invocation);
        Operation op = assertRemotingOperation(config, invocation, result);
        ExternalResourceDescriptor desc = assertExternalResource(op);
        assertNull("Unexpected external descriptor: " + desc, desc);
    }
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.