Do you know how does 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙧𝙪𝙣() work internally?
The 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣 class provides a convenient way to bootstrap a Spring application that is started from a main() method. By default, 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣 class will perform the following steps to bootstrap your application: 1. Creates an 𝙚𝙢𝙥𝙩𝙮 𝙀𝙣𝙫𝙞𝙧𝙤𝙣𝙢𝙚𝙣𝙩 𝙤𝙗𝙟𝙚𝙘𝙩. 2. Find the external configuration file like 𝙖𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙥𝙧𝙤𝙥𝙚𝙧𝙩𝙞𝙚𝙨 / 𝙖𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙮𝙢𝙡 from the classpath of the application and load these properties into the environment object. 3. Print 𝙎𝙥𝙧𝙞𝙣𝙜 𝘽𝙖𝙣𝙣𝙚𝙧. 4. Identifies the type of the application by using property 𝙒𝙚𝙗𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣𝙏𝙮𝙥𝙚 and instantiates an appropriate IOC Container. 5. Instantiates the 𝙎𝙥𝙧𝙞𝙣𝙜𝙁𝙖𝙘𝙩𝙤𝙧𝙞𝙚𝙨 and register with IOC Container. 6. Initialise the IOC Container by executing 𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣𝘾𝙤𝙣𝙩𝙚𝙭𝙩𝙄𝙣𝙞𝙩𝙞𝙖𝙡𝙞𝙯𝙚𝙧. 7. Prepare the context by 𝙋𝙧𝙚𝙥𝙖𝙧𝙚𝘾𝙤𝙣𝙩𝙚𝙭𝙩. 8. Refresh the context by 𝙍𝙚𝙛𝙧