Results 1 to 2 of 2

Thread: Spring Hhtp Invoker and Dynamic proxy

  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Default Spring Hhtp Invoker and Dynamic proxy

    Hi Every One,

    We use Apache Jmeter (Jmeter is java application, a tool for load testing client/server applications) and we have a remote component that are accessible only using Spring HTTPInvoker based calls.

    We have to build new Jmeter Sampler that will invoke a remote components that are accessible only using Spring HTTPInvoker calls.The remote component will return some objects as reponse, and the problem is we don't know in advance what's the type of that object and which method contains.

    Some one has an idea how we can do this ? I know we can use Dynamic proxy in case we don't know the inteface in advance but how we can use Spring Http Invoker with Dynamic proxy ?

    Any idea and example to follow are much appreciated,

    THank you very much in advance for your response.

    Best Regards,

  2. #2

    Default

    At what point will you know what the remote interface should be?

    If you must wait until runtime, you could try something like the following:

    Code:
    public <R extends Object> R getRemoteObject(Class<R> remoteInterface) {
        HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
        httpInvokerProxyFactoryBean.setServiceInterface(remoteInterface);
        httpInvokerProxyFactoryBean.setServiceUrl("http://localhost:8080/myapp/remoteService");
        httpInvokerProxyFactoryBean.afterPropertiesSet();
        return (R) httpInvokerProxyFactoryBean.getObject();
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •