Update bean property at runtime
<p>I have a bean that holds some configuration:</p>

<pre><code>public class CustomerService{
  private Config config;

  @Required
  public void setConfig(Config config){
    this.config = config;
  }
}

public Config {
  private String login;
  private String password;

  //setters/getters
}
</code></pre>

<p>app-context.xml:</p>

<pre><code>&lt;bean id="config" class="Config"/&gt;
&lt;bean id="customerService" class="CustomerService"&gt;
   &lt;property name="config" ref="config"/&gt;
&lt;/bean&gt;
</code></pre>

<p>and the config values are obtained at runtime (by calling api).
How to update those values at runtime? Can I do it using a setter:</p>

<pre><code>customerService.getConfig().setLogin("login");
</code></pre>