Rishi Shehrawat wrote:Spring is able to identify that RmiProxyFactoryBean is a factory bean as it implements the FactoryBean interface.
Right and if you look at the JavaDoc for a FactoryBean it would be clear how this works,
Interface to be implemented by objects used within a BeanFactory which are themselves factories. If a bean implements this interface, it is used as a factory for an object to expose, not directly as a bean instance that will be exposed itself.
NB: A bean that implements this interface cannot be used as a normal bean. A FactoryBean is defined in a bean style, but the object exposed for bean references (getObject() is always the object that it creates.