I would like to know how to tell Spring load a bean which I've defined in a context just once? Is this possible? How is this called and what do I need to do?
I'd basically like to make sure the class is never re-instantiated and that the same instance is re-used.
All beans in spring are singletons by default so they will be instantiated just once. So you have this out of the box and need just to register bean in context by xml or Annotations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With