Announcement Announcement Module
Collapse
No announcement yet.
Dynamic creation of bean definition at runtime Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic creation of bean definition at runtime

    Hello,

    I'd like to know if it is possible to create bean definition at runtime ?
    If yes, what is the best solution ?
    And once the definition has been created, how can I get an instance of the bean ?

    Thanks in advance.

  • #2
    I have found the solution, so I posted it here for those who are interested.

    Here is an interested link:
    http://www.jroller.com/habuma/entry/...iven_injection

    Here is the code I have used:
    Code:
    Map properties = new HashMap();
    properties.put("serviceUrl", serviceUrl.toString());
    properties.put("serviceInterface", GENERIC_SERVICE_INTERFACE);
    
    MutablePropertyValues mpvs = new MutablePropertyValues(properties);
    BeanDefinition res = new RootBeanDefinition(
        HttpInvokerUtils.HTTP_SERVICE_PROXY_CLASS, mpvs, true);
    I hope this will help someone...
    _____________________________ _ _ _
    bgOnline

    Comment

    Working...
    X