Results 1 to 2 of 2

Thread: Spring HttpInvoker: how to replace serviceUrl at runtime?

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    26

    Question Spring HttpInvoker: how to replace serviceUrl at runtime?

    The issue is discussed couple of times, but I was not able to find a solution that solves our problem.
    We have the following HttpInvoker service that takes the remote URL from Database:
    Code:
    @Service("exampleService")
    public class ExampleHttpInvoker extends HttpInvokerProxyFactoryBean {
    
        @Resource
        private DBService service;
    
        @PostConstruct
        public void init() throws ConfigurationException {
    
            String url = service.getURL();
            this.setServiceUrl(url);
            this.setServiceInterface(RemoteInterface.class);
            this.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
            afterPropertiesSet();
    
        }
    
    }
    The URL can be changed between remote calls.
    How to replace serviceUrl at runtime?
    We can not use Session or Request scope since the service is not Web aware.
    Any help will be appreciated.
    Best regards,
    Michael

  2. #2
    Join Date
    Nov 2004
    Posts
    26

    Default

    My clarification: I would be able to solve my problem if I would able to create the ExampleHttpInvoker before each remote call or upon DB modification. In Spring is possible to use @Scope(“request”) or @Scope(“session”), but these options are valid only in the context of a web-aware Spring ApplicationContext. I am looking for a way to recreate my ExampleHttpInvoker singleton.
    Any help will be appreciated.
    Best regards,
    Michael

Posting Permissions

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