Consider the following class:
public class LegacySingleton {
private LegacySingleton(){}
public static LegacySingleton getAServiceInstance() {
return new LegacySingleton();
}
}
How can a bean of type LegacySingleton be created (using XML configuration)? (select one)
A. It is not possible, the constructor must be public
B. Use the factory-method attribute on the
C. Use the init-method attribute on the
D. Use autowiring
Which of the following statements about Spring and unit testing is true? (Select one)
A. Spring provides an internal mock framework so there is no need for a third-party mock framework such as Mockito or EasyMock
B. Spring provides an abstraction to existing Mock frameworks
C. Both a and b
D. Neither a or b
Identify the correct statement about the following pointcut expression: execution(@javax.annotation.security.RolesAllowed * rewards.restaurant.*.*(..)) (Select one)
A. The return type of the target method is RolesAllowed
B. All method parameters should be annotated with @RolesAllowed
C. The target method may have one argument
D. All of the above
Which of the following statements defines a "pointcut"? (select one)
A. A point in the execution of a program such as a method call or field assignment
B. A module that encapsulates advices
C. An expression that selects one or more join points
D. None of the above
If the propagation behavior is Propagation.REQUIRES_NEW, choose the statement which describes the propagation behavior (select one)
A. Runs in a nested transaction if an active transaction exists. If an active transaction does not exist, the transaction behaves as if Propagation.REQUIRED is set
B. Supports a transaction if one already exists. Throws an exception if an active transaction does not exist.
C. Always starts a new transaction. If an active transaction already exists, it is suspended
D. Always executes without a transaction even if an active transaction exists. Throws an exeception if an active transaction exists.
Consider that all Spring beans have been declared within a package called "com.springsource.service". To enable component scanning one must do the following:
A. Nothing (component scanning is enabled by default)
B. Add
C. Add
D. Remove all other bean definitions from the XML configuration
Assuming a web application context name of "rewardsonline", a servlet mapping of "/admin/*", and an incoming URL of "/rewarsdonline/admin/accounts/show", what is the URL used for Spring MVC request-mapping purposes? (select one)
A. /rewardsonline/admin/accounts/show
B. /admin/acounts/show
C. /accounts/show
D. /show
Spring's RMI Service Exporter provides which of the following services? (select one)
A. Transparently exposes an existing POJO service to the RMI registry
B. Avoids the service interface having to extend Remote
C. Exposes services that can be accessed via plain RMI
D. All of the above
Which of the following statements comparing traditional RMI with Spring RMI is NOT true? (select one)
A. Traditional RMI requires the client to catch RemoteExceptions, but Spring's approach does not
B. Traditional RMI requires implementing java.rmi.Remote, but Spring's approach does not
C. Both approaches require you to extend the UnicastRemoteObject class on the server side
D. Both approaches require method parameters and return values to implement java.io.Serializable
What is the principal purpose of Spring's Security XML namespace? (Select one)
A. To provide a mechanism for applying security to Spring Web Services
B. To provide a schema for configuring Spring Security in a Spring XML configuration file
C. To provide a mechanism for encrypting Spring Security XML configuration files
D. To allow Spring Security to be applied to XHTML