Ssmeki,
You can share a bean instance between two XmlBeanFactory by using a parent XmlBeanFactory:
- P (parent XmlBeanFactory): contains the shared bean you want to use in A and B
- A: remove definition of your shared bean
- B: remove definition of your shared bean
When you instanciate A and B, provide P as the value of parameter parentBeanFactory
Code:
XmlBeanFactory p = new XmlBeanFactory(isP);
XmlBeanFactory a = new XmlBeanFactory(isA, p);
XmlBeanFactory b = new XmlBeanFactory(isB, p);
XmlBeanFactory A and B will inherits your shared bean definition / instance from P.
HTH