I am not sure if anyone following my Thread but I understoond that for each new bean I want to create dynamiclly I can do something like this:
Code:
public void createBean(String beanName, String beanParam)
{
System.out.println("beanName=" + beanName + " beanParam=" + beanParam);
ApplicationContext context = ApplicationContextSingleton.getApplicationContext();
innerContext = new StaticApplicationContext(context);
innerContext.registerSingleton(beanName, FixSessionBean.class);
configureBean(innerContext, beanName, beanParam);
}
Code:
public void configureBean(ApplicationContext innerContext, String beanName, String beanParam)
{
FixSessionBean fixSessionBean = (FixSessionBean) innerContext.getBean(beanName);
fixSessionBean.setMyProperty("32");
}
and If I want to retrieve it in the future ill just use:
Code:
FixSessionBean fixSessionBean = (FixSessionBean) innerContext.getBean(beanName);
FixedSessionBean in the xml:
Code:
<bean id="FixSessionBean" class="com.fixgw.beans.FixSessionBean" />
my question is: if I use StaticApplicationContext to create new beans and manage them in the way I just show could be that in future will it harm performences/memory leaks, etc ?
thanks,
ray.