How can a bean of type LegacySingleton be created (using XML configuration)? (select one)

How can a bean of type LegacySingleton be created (using XML configuration)? (select one) Consider the following class: public class LegacySingleton { private LegacySingleton(){} public static LegacySingleton getAServiceInstance() { return new LegacySingleton(); } }A . It is not possible, the constructor must be publicB . Use the factory-method attribute on...

February 21, 2020 No Comments READ MORE +

Using Spring AOP, which of the following Spring annotations cause behavior to be added (select one)

Using Spring AOP, which of the following Spring annotations cause behavior to be added (select one)A . @SecuredB . @TransactionalC . Both a and bD . Neither a or bView AnswerAnswer: C

February 20, 2020 No Comments READ MORE +

Which of the following statements is true regarding the above code sample? (Select one)

Which of the following statements is true regarding the above code sample? (Select one) <bean name="clientService" class="com.foo.ClientServiceImpl" p:name="myName"/>A . This syntax requires the declaration of the "p" namespaceB . myName is a scalar value (as opposed to a reference to an existing bean)C . Both a and bD . Neither...

February 19, 2020 No Comments READ MORE +

Which of the following statements best describes the benefits of using the Spring Framework with respect to unit testing? (Select one)

Which of the following statements best describes the benefits of using the Spring Framework with respect to unit testing? (Select one)A . Your Java code typically has dependencies on Spring Framework classes which are designed to make the job of unit testing easierB . The Spring Framework encourages you to...

February 17, 2020 No Comments READ MORE +

Which of the following statements about the BeanFactoryPostProcessor are true? (select one or several answers)

Which of the following statements about the BeanFactoryPostProcessor are true? (select one or several answers)A . Allows for the transformation of Spring bean definitions before the beans are instantiatedB . Allows for the transformation of Spring beans after the beans have been instantiatedC . Detects annotations such as @PostConstruct and...

February 16, 2020 No Comments READ MORE +

Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of the following @Autowired scenarios will cause the ApplicationContext to FAIL to initialize?

Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of the following @Autowired scenarios will cause the ApplicationContext to FAIL to initialize? Assume that the ApplicationContext is configured to process the @Autowired annotations. (Select one)A . @Autowired public void setFoo(Foo aFoo) {}B . @Autowired private Foo...

February 16, 2020 No Comments READ MORE +

Identify the correct statement(s) about the following pointcut expression:

Identify the correct statement(s) about the following pointcut expression: execution(* rewards..restaurant.*.*(*)) (select one or several answers)A . There may be several directories between 'rewards' and 'restaurant'B . There is no restriction on the class nameC . The target method may have several argumentsD . The return type must not be...

February 16, 2020 No Comments READ MORE +

Which of the following scenarios requires you to instantiate an ApplicationContext using the ‘new’ keyword? (Select one)

Which of the following scenarios requires you to instantiate an ApplicationContext using the ‘new’ keyword? (Select one)A . Running your Spring application inside a JUnit test (using SpringJUnit4ClassRunner)B . Bootstrapping your Spring application within a Java main() methodC . Deploying your Spring application in an application server, packaged in a...

February 15, 2020 No Comments READ MORE +

What is the primary purpose of bean definition inheritance? (Select one or several answers)

What is the primary purpose of bean definition inheritance? (Select one or several answers)A . To configure Java class inheritance dynamically within the XML bean definition fileB . To reduce the amount of configuration required by inheriting properties from other bean definitionsC . To allow Spring beans to be created...

February 15, 2020 No Comments READ MORE +