I have a factory class which has various static methods to return the instances of some classes. How can a bean be created in spring using static factory method in different class?
something like:
public class InstanceFactory
{
public static JellyBean getJellyBeanInstance()
{
return new JellyBean();
}
}
I need a JellyBean.
Just change your
getJellyBeanInstance()
method to non-static, then you need: