java - which context.getBean to use when get the bean from spring -


निम्न लिंक में

यह एक्सएमएल जैसे बीन को परिभाषित करता है

 < कोड> & lt; खरगोश: टेम्पलेट आईडी = "amqpTemplate" connection-factory = "connectionFactory" / & gt;  

फिर कॉलिंग कोड में, इसका उपयोग

  AmqpTemplate टेम्पलेट = context.getBean (AmqpTemplate.class);  

इसे क्यों उपयोग किया गया

  context.getBean (AmqpTemplate.class);  

के बजाय

  context.getBean ("amppTemplate");  

GetBean क्या है (AmqpTemplate.class) का मतलब है? मुझे यह XML द्वारा परिभाषित नहीं मिल रहा है।

getBean () < / पूर्व>

एक अतिभारित विधि है आप बीन नाम या बीन प्रकार से कॉल कर सकते हैं। क्लास के साथ कॉलिंग इस क्लास प्रकार का एकल उदाहरण देता है। अगर एक से अधिक एक अपवाद फेंकता है अगर कोई फिर से एक अपवाद फेंकता नहीं है।

देखें।


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -