Java Spring ClassPathXmlApplicationContext ( Cache autowire )

时间:2019-01-12 09:17:26

标签: spring applicationcontext

By using the @Autowire annotation on the classes its possible to use spring to invert autowiring. When loading the applicationcontext I use this piece of code.

ApplicationContext context = new ClassPathXmlApplicationContext("All.xml");

Over the time my application has grown and the initialization is beginning to take more time. This line of code now takes roughly 10 seconds to load.

Obviously this builds the applicationcontext, but is is possible to fetch the result after its build save it and use it for cache. Or does Spring have something build in caching to improve startup time?

0 个答案:

没有答案
相关问题