Package org.springframework.remoting.support

Examples of org.springframework.remoting.support.RemoteInvocation


        }
    }

    public void onMessage(Message message) {
        try {
            RemoteInvocation invocation = marshaller.readRemoteInvocation(message);
            if (invocation != null) {
                boolean oneway = false;
                if (invocation instanceof LingoInvocation) {
                    LingoInvocation lingoInvocation = (LingoInvocation) invocation;
                    oneway = lingoInvocation.getMetadata().isOneWay();
View Full Code Here


        pfb.setServiceInterface(ITestBean.class);
        pfb.setServiceUrl("http://myurl");
        pfb.setRequestor(createRequestor(getDestinationName()));
        pfb.setRemoteInvocationFactory(new LingoRemoteInvocationFactory(strategy) {
            public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) {
                RemoteInvocation invocation = super.createRemoteInvocation(methodInvocation);
                invocation.addAttribute("myKey", "myValue");
                try {
                    invocation.addAttribute("myKey", "myValue");
                    fail("Should have thrown IllegalStateException");
                }
                catch (IllegalStateException ex) {
                    // expected: already defined
                }
                assertNotNull(invocation.getAttributes());
                assertEquals(1, invocation.getAttributes().size());
                assertEquals("myValue", invocation.getAttributes().get("myKey"));
                assertEquals("myValue", invocation.getAttribute("myKey"));
                return invocation;
            }
        });
        configure(pfb);
View Full Code Here

        pfb.setServiceInterface(ITestBean.class);
        pfb.setServiceUrl("http://myurl");
        pfb.setRequestor(createRequestor(getDestinationName()));
        pfb.setRemoteInvocationFactory(new LingoRemoteInvocationFactory(strategy) {
            public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) {
                RemoteInvocation invocation = super.createRemoteInvocation(methodInvocation);
                assertNull(invocation.getAttributes());
                assertNull(invocation.getAttribute("myKey"));
                return invocation;
            }
        });
        configure(pfb);
View Full Code Here

        this.pojo = pojo;
        this.marshaller = marshaller;
    }

    public boolean handle(Message message) throws JMSException {
        RemoteInvocation invocation = marshaller.readRemoteInvocation(message);
        try {
            invoke(invocation, pojo);
        }
        catch (NoSuchMethodException e) {
            onException(invocation, e);
View Full Code Here

    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName(methodName);
    request.setParameters(parameters);

    RemoteInvocation remoteInvocation = this.serviceExporter
        .findMatchingMethod(request);

    assertEquals("<Method name>", methodName, remoteInvocation.getMethodName());

    Class[] expectedParameterTypes = { Long.class };
    Class[] actualParameterTypes = remoteInvocation.getParameterTypes();
    assertTrue("<Parameter Types>. Expected: '"
        + Arrays.toString(expectedParameterTypes) + "' but was: '"
        + Arrays.toString(actualParameterTypes), Arrays.equals(
        expectedParameterTypes, actualParameterTypes));

    Object[] expectedArguments = { customerId };
    Object[] actualArguments = remoteInvocation.getArguments();

    assertTrue("<Arguments>. Expected: '" + Arrays.toString(expectedArguments)
        + "' but was: '" + Arrays.toString(actualArguments), Arrays.equals(
        expectedArguments, actualArguments));
  }
View Full Code Here

    XmlRpcRequest request = new XmlRpcRequest();
    request.setMethodName(methodName);
    request.setParameters(parameters);
   
    RemoteInvocation invocation = new RemoteInvocation();
    invocation.setMethodName("getCustomerName");
    invocation.setParameterTypes(new Class[] { Long.class });
    invocation.setArguments(new Object[] { argument });

    // expectation: call the service method.
    this.myService.getCustomerName(argument);
    this.myServiceControl.setReturnValue(customerName);
View Full Code Here

    if (targetMethod == null) {
      throw new XmlRpcMethodNotFoundException("Unable to find method "
          + Strings.quote(requestMethodName) + "");
    }

    RemoteInvocation invocation = new RemoteInvocation(targetMethod.getName(),
        targetMethod.getParameterTypes(), arguments);
    return invocation;
  }
View Full Code Here

  /**
   * @see XmlRpcServiceExporter#invoke(XmlRpcRequest)
   * @see #findMatchingMethod(XmlRpcRequest)
   */
  public Object invoke(XmlRpcRequest xmlRpcRequest) throws Exception {
    RemoteInvocation invocation = findMatchingMethod(xmlRpcRequest);
    return invoke(invocation, service);
  }
View Full Code Here

      throws JMSException, MessageConversionException {

    Message m = super.toMessage(object, session);

    if (object instanceof RemoteInvocation) {
      RemoteInvocation invocation = (RemoteInvocation) object;
     
      // If its a invocation of remoteJobRequest
      if (invocation.getMethodName().equals("remoteJobRequest")) {
       
        // Attach Target ClusterID
        m.setStringProperty("targetClusterId",
                  parseClusterId((String) invocation
                      .getArguments()[0]));
      }
    }

    return m;
View Full Code Here

    }

    public Object onCall(MuleEventContext eventContext) throws Exception
    {
        Object payload = eventContext.getMessage().getPayload();
        RemoteInvocation ri = (RemoteInvocation) payload;
        Object rval = delegate.execute(ri);
        return rval;
    }
View Full Code Here

TOP

Related Classes of org.springframework.remoting.support.RemoteInvocation

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.