Test Series - spring

Test Number 12/20

Q: Interface used to create additional features in groovy based beans
A. GroovyObjectCustomizer
B. GroovyBeanCustomizer
C. GroovyCustomizer
D. None of the mentioned
Solution: The GroovyObjectCustomizer interface is a callback that allows you to hook additional creation logic into the process of creating a Groovy-backed bean.
Q: Attribute which specifies all the interfaces
A. script-interfaces
B. lang:bsh
C. lang:script
D. script:bsh
Solution: Spring creates a JDK dynamic proxy implementing all of the interfaces that are specified in the ‘script-interfaces’.
Q: Class-based proxies are best way to advise scripted beans
A. True
B. False
C. 1
D. 0
Solution: There is just one (small) thing that you need to be aware of when advising scripted beans. You cannot use class-based proxies, you must use interface-based proxies.
Q: Element which allows you to control the scope
A. lang:jruby
B. lang:language
C. lang: bsh
D. lang:groovy
Solution: The scope attribute on the various lang:language/ elements allows you to control the scope of the underlying scripted bean, just as it does with a regular bean.
Q: BeanShell Library dependencies
A. bsh-2.0b4.jar
B. cglib-nodep-2.1_3.jar
C. all of the mentioned
D. none of the mentioned
Solution: All of these libraries are available in the Spring-with-dependencies distribution of Spring (in addition to also being freely available on the web).
Q: Attribute used by Spring to refresh beans
A. refresh-check-interval
B. refresh-check-delay
C. refresh-delay
D. none of the mentioned
Solution: Spring is able to refresh a scripted bean definition from its source once you have specified the checking interval in the refresh-check-delay attribute.
Q: Spring IoC container refreshes the script periodically according to the interval period specified
A. True
B. False
C. 1
D. 0
Solution: When a method is called on that bean, Spring will check the script source if the specified checking interval has elapsed. The Spring will refresh the bean definition from the script source if it has been changed.
Q: Default value of refresh-check-delay attribute
A. Zero
B. Negative
C. Positive
D. None of the mentioned above
Solution: By default, the refresh-check-delay attribute is negative, so the refresh checking feature is disabled. You can assign the milliseconds for refresh checking in this attribute to enable this feature.
Q: XML Element to define an inline script
A. lang:inlinescript
B. lang:inline_script
C. lang:inline@script
D. lang:inline-script
Solution: You can define an inline script source in the lang:inline-script element of a scripted bean to replace a reference to an external script source file by the script-source attribute.
Q: Refresh checking feature is not applicable for an inline script
A. True
B. False
C. 1
D. 0
Solution: Spring IoC container only loads the bean configuration once, at startup.

You Have Score    /10