Check if this registry contains a singleton instance with the given name.
true if this bean factory contains a singleton instance with the given name; otherwise,
Only checks already instantiated singletons; does not return
truefor singleton bean definitions which have not been instantiated yet.
The main purpose of this method is to check manually registered singletons RegisterSingleton. Can also be used to check whether a singleton defined by an object definition has already been created.
To check whether an object factory contains an object definition with a given name, use ListableBeanFactory's
ContainsObjectDefinition. Calling both
ContainsSingletonanswers whether a specific object factory contains an own object with the given name.
ContainsObjectfor general checks whether the factory knows about an object with a given name (whether manually registered singleton instance or created by bean definition), also checking ancestor factories.