This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Spring Container Queries  RSS feed

 
Ranch Hand
Posts: 386
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose we have a Spring MVC application running on Tomcat/WAS. I would like to understand

1. how the spring container is loaded ?

2. When is it loaded?


3. Can we have multiple instances of spring container?
 
Bartender
Posts: 20334
110
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said tou you here, I don't think I'd use the term "Container" for Spring. Spring is a provisioner and a configurator, and it supplies a number of frameworks, but the actual "container" for a webapp is the deployed WAR in the webapp server.

And since Spring is not a standard J2EE or JEE service provided by the container, that means that each webapp has to include Spring (or not) if it needs it as part of the WAR.

It's "loaded" as simply another set of classes the same way all classes are loaded. There's no Spring Thread or process, just a Factory that the application can draw upon whenever it needs a particular bean.

And the answer to your third question was given in the other message thread I mentioned.
 
Bartender
Posts: 1002
16
Java Linux Mac OS X Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could start here; Spring Framework’s Inversion of Control (IoC) container.  

You could have many instances of the application context (IoC), but I'm not sure why would would do so.  If you wanted different configurations dependant upon runtime environments (for example for development, testing, live production) then springs profiles are designed to offer that functionality.    

Note that the term "container" has became one of the overused terms in computing.  It now has different meanings depending on the subject matter.  
The Spring IoC does not have much in common with other technologies that use the same term (like docker or JEE).  
 
Tim Holloway
Bartender
Posts: 20334
110
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Peter Rooke wrote:The Spring IoC does not have much in common with other technologies that use the same term (like docker or JEE).  



Which is why I don't like to call it a container, despite what the official docs say.

As containers go, it's a leaky one. Although technically it can manage beans over their entire lifecycle, in actuality a raw bean, once manufactured and returned to application code is mostly on its own.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!