Announcement Announcement Module
Collapse
No announcement yet.
changing object factory property at runtime Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • changing object factory property at runtime

    I have a client factory Spring bean defined as a singleton which includes a property called disabled. On startup of the app if the property is set to true, then the object factory will skip initializing and just return a null object.

    My question is how can I accomplish changing the "disabled" property at runtime and have the factory create a client and vise versa? The goal here is to enable/disable the factory (and the client it initializes/reinitializes) without restarting the application. I have the disabled property defined/injected via contextroperty-placeholder.

    Here's a gist of the factory in question: https://gist.github.com/1627584

    Thanks.
    Last edited by digitalsanctum; Jan 17th, 2012, 11:20 AM.

  • #2
    I'm not sure if I understand you but...

    FactoryClientTransport fct = ctx.getBean("fct");
    fct.setEnabled(true);
    fct.afterPropertiesSet( );

    Cheers

    Comment

    Working...
    X