Deck 1: Core-Spring (based on Spring 3.2)

ملء الشاشة (f)
exit full mode
سؤال
Select which of the following configuration tasks would be implemented using Spring's XML "context" namespace (select one or several answers)

A) Enabling component-scanning
B) Enabling the use of the @Transactional annotation
C) Enabling the use of the @Required, @PreDestroy and @PostConstruct annotations
D) Enabling the use of the @Around annotation
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Select which statement is true with respect to constructor injection with Spring (select one)

A) Multiple parameters can be dependency injected into a constructor
B) Using XML configuration, the constructor-arg element may be omitted if the constructor requires a single parameter
C) One single bean cannot mix constructor injection with setter injection
D) All of the above
سؤال
Which of the following statements about the FactoryBean interface is NOT true? (select one)

A) A FactoryBean can be used to generate Spring beans of any type
B) The Spring configuration will ALWAYS inject the instance of the FactoryBean implementation
C) FactoryBean is a Spring interface
D) Factory objects used in Spring do not necessarily have to implement the FactoryBean interface
سؤال
Which of the following statements about the @PostConstruct annotation is NOT true? (select one)

A) It is a JSR-250 standard Java annotation
B) There are no restrictions on method name or visibility of a method which can be annotated with @PostConstruct
C) It can be enabled using the tag
D) It is called before setter injection
سؤال
ClientService service = applicationContext.getBean(ClientService.class) Which statement is true with regards to the above example? (select one)

A) It returns the bean called "ClientService"
B) It returns a bean of the type ClientService (regardless of its id or name)
C) This syntax is not valid because the bean id must be specified as a method param
D) This syntax is not valid because the result of the getBean method should be explicitely cast into ClientService
سؤال
Which of the following statements about use of the @Transactional annotation in a JUnit integration test is NOT true? (Select one)

A) Annotating a test with @Transactional will cause the test method to run in a transaction
B) Annotating a test class with @Transactional will cause all its test methods to run in transactions
C) Application code that runs in a transaction with REQUIRES_NEW propagation can have those changes rolled back by an @Transactional test
سؤال
Which of the following statements is NOT true with respect to Spring's ApplicationContext? (select one)

A) The ApplicationContext eagerly instantiates all singleton beans by default
B) There are many different implementation classes which all implement the ApplicationContext interface
C) When available, the close() method will cause any registered bean destruction code to be invoked
D) In a JUnit test using Spring support (with @ContextConfiguration annotation), it is necessary to close the ApplicationContext manually
سؤال
Two beans of type MyBean are defined in the ApplicationContext with singleton scope, with ids "myBean1" and "myBean2". The getBean() method is called once for each bean. Which statement is true about the two references returned? (Select one)

A) The two references refer to different instances of the same type
B) Both references refer to the same bean instance
C) One of the references will be null
D) A RuntimeException will be thrown when the ApplicationContext is initialized
سؤال
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 foo;
C) Both a and b
D) Neither a or b
سؤال
import com.springsource.service.*; ... @Configuration public class AppConfig { @Bean public ClientService clientService() { return new ClientServiceImpl(); } } What is the id of the declared bean? (Select one)

A) clientService (starting with lower-case "c")
B) ClientService (starting with capital "C")
C) com.springsource.service.ClientService
D) com.springsource.service.ClientServiceImpl
سؤال
Which of the following statements is NOT true concerning Setter Injection or Constructor Injection? (Select one)

A) Constructor injection is useful when you must have an instance of a dependency class before your component is used
B) Setter injection is useful if a component can provide its own defaults
C) Using the @Autowired annotation, setter injection also works when the setter method is private
D) Using setters promotes immutability
سؤال
Using Spring AOP, which of the following Spring annotations cause behavior to be added (select one)

A) @Secured
B) @Transactional
C) Both a and b
D) Neither a or b
سؤال
Which of the following statements about Spring's JUnit integration testing support is true? (select one)

A) A new ApplicationContext is initialized and created for each test method
B) To obtain references to  the Spring bean(s) you want to test, you need to call getBean() on the ApplicationContext provided
C) You can indicate which XML configuration files the test class will use to create the ApplicationContext
D) All of the above
سؤال
What is true regarding bean definition inheritance?

A) Parent bean definitions should always be abstract
B) Parent bean definitions may be abstract
C) The class attribute can be declared in a parent bean definition
D) It is not useful to declare an id for a parent bean definition
سؤال
Consider the following complete configuration sample:
< bean class="rewards.internal.RewardNetworkImpl" >
< property name="accountRepository" ref="accountRepository" />
< /bean>
< bean class="rewards.internal.account.JdbcAccountRepository"/>
Which of the following statements is true? (Select one)

A) This configuration is correct
B) This configuration is not valid because the first bean should have an id. Its value should be "rewardNetwork".
C) This configuration is not valid because the second bean should have an id. Its value should be "accountRepository".
D) Both (b) and (c)
سؤال
@Configuration public class AppConfig {     @Bean     public ClientService clientService()
{         ClientServiceImpl clientService = new ClientServiceImpl();         
ClientService.addClientDao(new ClientDao());         
Return clientService;     }
In the example above, which statement is NOT true with regards to Spring Java configuration? (select one)

A) The declared bean is a singleton by default
B) This bean might be wrapped by a proxy
C) This bean cannot use a method starting with "add" to inject a dependency
D) The bean is of type ClientService
سؤال
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 easier
B) The Spring Framework encourages you to program to interfaces which makes it easier to stub or mock out dependencies in your code
C) The extensive runtime checks performed by the ApplicationContext when it initializes make traditional unit testing less important
D) All of the above
سؤال
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 file
B) To reduce the amount of configuration required by inheriting properties from other bean definitions
C) To allow Spring beans to be created on the fly from classes declared as abstract
D) To simplify configuration by allowing multiple properties files to be loaded in a hierarchy to specify bean properties
سؤال
Which of the following statements about the @Autowired annotation is NOT true? (select one)

A) The default behavior is that if a dependency cannot be satisfied with @Autowired, the ApplicationContext will throw a RuntimeException
B) @Autowired is a Spring-specific annotation
C) Multiple arguments can be injected into a single method using @Autowired
D) It cannot be used to annotate fields, only constructors and methods
سؤال
Which of the following statements is NOT true concerning the BeanPostProcessor Extension point? (Select one)

A) BeanPostProcessors are called during the init phase
B) BeanPostProcessors are called after the dependencies have been injected
C) BeanPostProcessors are called before the BeanFactoryPostProcessors have been called
D) Custom BeanPostProcessors can be implemented
سؤال
Which of the following statements defines an "aspect"? (select one)

A) An encapsulation of advice combined with a pointcut.
B) A point in the execution of a program such as a method call or field assignment
C) An expression that selects one or more join points
D) Code to be executed at a join point that has been selected by a Pointcut
سؤال
Consider the following bean definition Using Spring AOP, you have declared a Pointcut targeting all methods inside the clientService bean. ClientServiceImpl implements 3 different interfaces. Which interfaces will the proxy class implement? (Select one)

A) All interfaces
B) The proxy class does not implement any interface
C) A Spring bean should never implement any interface
سؤال
Which statement concerning Aspect Oriented Programming (AOP) is true (Select one)

A) AOP modularizes cross-cutting concerns
B) Spring AOP implements aspects using the Proxy pattern
C) Three of the advice types are "before", "after" and "around"
D) All of the above
سؤال
Which of these is NOT a characteristic of Spring JDBC? (Select one)

A) Can be configured exclusively using annotations
B) Provides a callback approach when greater developer control is needed
C) Connections are acquired and released from the DataSource automatically
D) Translation of root cause checked exceptions to Spring DataAccessExceptions
سؤال
Which of the following statements is true with respect to Spring's support for Object-Relational Mapping (ORM) libraries (select one)

A) Spring supports management of Hibernate Sessions or JPA PersistenceContexts in combination with local transactions
B) Spring provides support for translating exceptions thrown from ORM libraries into Spring's own exception hierarchy
C) Spring provides FactoryBeans to configure each of the supported ORM libraries
D) All of the above is true
سؤال
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 name
C) The target method may have several arguments
D) The return type must not be "void"
سؤال
Which of the following statements is NOT a characteristic of Spring Transaction Management? (Select one)

A) It abstracts the differences between local and JTA transactions
B) It simplifies migration to distributed transactions
C) The use of JTA transactions is a requirement
D) Both declarative and programmatic transaction management is supported
سؤال
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
سؤال
Identify the correct statement(s) about the following pointcut expression: execution(* rewards.restaurant.*Service.find(..))

A) The target's type should end with "Service"
B) The target method name could be "findRestaurantById"
C) The target method should have one argument only
D) The target method may have several arguments
سؤال
To register for a bean destruction callback, one can (Select one)

A) Decorate the destroy method with @PreDestroy
B) Decorate the destroy method with @PreDestroy and add a xml declaration
C) Set the bean instance in a "prototype" scope
D) Set the lazy-init attribute within the tag
سؤال
Which of the following statements is NOT true about Spring AOP? (Select one)

A) "private" methods cannot be advised, but all other method visibilities can be
B) Proxy classes are created at startup time by default
C) The "After Throwing" advice type executes after the join point, but executes only if the advised method threw an exception
D) The "After" advice type is invoked regardless of whether a method successfully returned or an exception is thrown
سؤال
Which of the following statements best describes the After Throwing advice type? (select one)

A) The advice is executed after a method invocation throws an exception
B) Custom processing can be performed before a join point executes
C) The advice is invoked only if the method returns successfully
D) The advice is designed to allow exceptions thrown from a join point to be caught and prevented from propagating up the stack
سؤال
Which of the following statements about Pointcut expressions is true? (Select one)

A) A Pointcut can be defined either within annotations in Java code or within XML configuration
B) A pointcut expression can include operators such as the following: && (and),|| (or), ! (not)
C) A Pointcut expression can be used to select join points which have been annotated with a specific annotation
D) All of the above is true
سؤال
Identify the correct statement(s) regarding the tag (Select one or multiple answers)

A) Can only be used with AspectJ (as opposed to Spring AOP)
B) Enables the detection of @Aspect annotated classes
C) Allows to define a list of names to include so Spring is not going to scan all the beans at startup
سؤال
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
سؤال
Which of the following statements is NOT true about advice types and exception handling?  (select one)

A) If a Before advice method throws an exception, the target method will not be called
B) An Around advice type can swallow, or halt the propagation of, an exception thrown by the target method.
C) An AfterReturning advice type can swallow, or halt the propagation of, an exception thrown by the target method.
سؤال
Identify the correct statement(s) regarding the following pointcut: execution(@com.springsource.MyCustomAnnotation void *(..))

A) Spring does not support annotations inside its pointcut expression language
B) This will select join points representing void methods that are annotated by @com.springsource.MyCustomAnnotation
C) This will select join points representing methods that may have a public, protected or default visibility
D) This pointcut will in no situation ever be able to select any join points
سؤال
Which statement best describes the advantage of using AfterReturning advice, rather than simply using after advice? (Select one)

A) If an exception is thrown in the join point, it is allowed to propagate, which is not the case with After advice
B) AfterReturning advice is invoked if an exception is thrown, which is not the case with After advice
C) After advice can only be applied to methods which are declared as void
D) AfterReturning advice is only invoked if the method returns successfully, allowing you to limit advice to only those scenarios
سؤال
State which type of object the JdbcTemplate can be used to query (select one)

A) Simple types (int, long, String, etc)
B) Generic Maps
C) Domain Objects
D) All of the above
سؤال
Which of the following statements is NOT true about advice types (select one)

A) The Before advice method is able to obtain information about the target method's return type
B) The After advice method is able to obtain information about the target method's return type
C) The Before advice method is able to obtain the target method's return value
D) The After advice method is able to obtain the target method's return value
سؤال
Security filters are used in Spring Security in which ways? (select one)

A) To drive authentication
B) To enforce authorization of web requests
C) To provide a logout capability
D) All of the above
سؤال
@Transactional(timeout=60) public class ClientServiceImpl implements ClientService { @Transactional(timeout=30) public void update1() {} } What timeout setting is applied to the timeout inside the update1 method? (Select one)

A) 60
B) 30
C) This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the class level
D) This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the method level
سؤال
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
سؤال
Which of the following statements is NOT true concerning Spring Remoting? (Select one)

A) Spring exporters handle the binding to a registry or exposing an endpoint
B) Spring provides FactoryBeans that generate proxies to handle client-side requirements
C) The client-side implementation must catch RemoteExceptions
D) Spring proxies convert RemoteExceptions to a runtime exception hierarchy
سؤال
Which of the following statement(s) is/are true concerning Spring Transactions? (Select one or several answers)

A) Spring only provides support for declarative transaction management, there is no programmatic support
B) Spring provides declarative transactions only using XML
C) An AOP pointcut can be used to define which methods to advise for transactions
D) Spring's tx namespace enables a concise definition of transactional advice
سؤال
Select which of the following is a mechanism which can be used with Spring Security to store user details (select one)

A) Database
B) LDAP
C) Properties file
D) All of the above
سؤال
In what order will these events occur during the initialization of the application? (Select one) Select the best response 1 Setter Dependency Injection 2 Bean constructor 3 call BeanFactoryPostProcessors 4 call BeanPostProcessors

A) 3, 2, 1, 4
B) 4, 2, 1, 3
C) 2, 1, 4, 3
D) 3, 1, 2, 4
سؤال
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 to your XML configuration
C) Add to your XML configuration
D) Remove all other bean definitions from the XML configuration
سؤال
Consider the following Spring Security configuration       In order to access to "/accounts/editAccount.htm", what role is required? (select one)

A) ROLE_USER
B) ROLE_ADMIN
C) Both ROLE_USER and ROLE_ADMIN
D) No role is required
سؤال
Which statement is NOT a characteristic of Spring's PlatformTransactionManager base interface (select one)

A) When declaring a PlatformTransactionManager implementation inside Spring configuration: as a requirement, the bean id should be "transactionManager"
B) The PlatformTransactionManager interface abstracts the differences between local and JTA transactions
C) There are various implementations of JTA transaction managers for different Java EE containers
D) PlatformTransactionManager is used in both declarative and programmatic transaction management
سؤال
Which of the following statements about Spring @MVC is NOT true (select one)

A) Classes annotated with @Controller annotation can be detected by component scanning and loaded as Spring beans
B) Data can be passed from the controller to the view by use of the special Model parameter
C) Controllers are typically able to delegate to business methods in an application because a reference to a service bean can be injected into the controller
D) The DispatcherServlet, controller beans and other collaborators are all defined and configured in web.xml
سؤال
Which statement is NOT true concerning Spring's RMI Proxy Generator (select one)

A) Spring provides a FactoryBean implementation that generates the RMI client-side proxy
B) The client-side proxy converts checked RemoteExceptions into Spring's runtime hierarchy of RemoteAccessExceptions
C) The proxy does not have to dynamically implement the interface of the remote service implementation
D) The client-side proxy contains all necessary information to connect to the remote service, such as the RMI Registry URL
سؤال
public class ClientServiceImpl implements ClientService { @Transactional(propagation=Propagation.REQUIRED) public void update1() { update2(); } @Transactional(propagation=Propagation.REQUIRES_NEW) public void update2() { // ... } You are using transactions with Spring AOP. What is happening when the update1 method is called? (Select one)

A) There is only one transaction because the call to update2() is internal (it does not go through the proxy)
B) There is only one transaction because REQUIRES_NEW runs into the active transaction if one already exists
C) There are 2 transactions because REQUIRES_NEW always runs in a new transaction
سؤال
Which of the following methods is NOT provided by the JmsTemplate? (select one)

A) setDefaultDestination
B) onMessage (asynchronous call)
C) convertAndSend
D) receiveAndConvert (synchronous call)
سؤال
Consider the following Spring JMS configuration Which of the following statements is truE. (select one)

A) Spring will automatically receive messages from the order.queue.destination
B) The orderListener bean has to implement javax.jms.MessageListener or Spring's SessionAwareMessageListener interface
C) The application needs to run in an application server that provides a JMS implementation out of the box
D) Spring will automatically send a response message
سؤال
Which of the following is a valid optional attribute for a transaction definition? (select one)

A) Propagation behavior
B) An isolation level
C) A read-only flag
D) All of the above
سؤال
Which of the following is NOT true about the @RequestMapping annotation?  (select one)

A) It is an annotation for mapping web requests to controller methods.
B) It is commonly used for component scanning purpose.
C) You can use it only with @Controller annotated classes.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/57
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 1: Core-Spring (based on Spring 3.2)
1
Select which of the following configuration tasks would be implemented using Spring's XML "context" namespace (select one or several answers)

A) Enabling component-scanning
B) Enabling the use of the @Transactional annotation
C) Enabling the use of the @Required, @PreDestroy and @PostConstruct annotations
D) Enabling the use of the @Around annotation
A,C
2
Select which statement is true with respect to constructor injection with Spring (select one)

A) Multiple parameters can be dependency injected into a constructor
B) Using XML configuration, the constructor-arg element may be omitted if the constructor requires a single parameter
C) One single bean cannot mix constructor injection with setter injection
D) All of the above
A
3
Which of the following statements about the FactoryBean interface is NOT true? (select one)

A) A FactoryBean can be used to generate Spring beans of any type
B) The Spring configuration will ALWAYS inject the instance of the FactoryBean implementation
C) FactoryBean is a Spring interface
D) Factory objects used in Spring do not necessarily have to implement the FactoryBean interface
B
4
Which of the following statements about the @PostConstruct annotation is NOT true? (select one)

A) It is a JSR-250 standard Java annotation
B) There are no restrictions on method name or visibility of a method which can be annotated with @PostConstruct
C) It can be enabled using the tag
D) It is called before setter injection
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
5
ClientService service = applicationContext.getBean(ClientService.class) Which statement is true with regards to the above example? (select one)

A) It returns the bean called "ClientService"
B) It returns a bean of the type ClientService (regardless of its id or name)
C) This syntax is not valid because the bean id must be specified as a method param
D) This syntax is not valid because the result of the getBean method should be explicitely cast into ClientService
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following statements about use of the @Transactional annotation in a JUnit integration test is NOT true? (Select one)

A) Annotating a test with @Transactional will cause the test method to run in a transaction
B) Annotating a test class with @Transactional will cause all its test methods to run in transactions
C) Application code that runs in a transaction with REQUIRES_NEW propagation can have those changes rolled back by an @Transactional test
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following statements is NOT true with respect to Spring's ApplicationContext? (select one)

A) The ApplicationContext eagerly instantiates all singleton beans by default
B) There are many different implementation classes which all implement the ApplicationContext interface
C) When available, the close() method will cause any registered bean destruction code to be invoked
D) In a JUnit test using Spring support (with @ContextConfiguration annotation), it is necessary to close the ApplicationContext manually
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
8
Two beans of type MyBean are defined in the ApplicationContext with singleton scope, with ids "myBean1" and "myBean2". The getBean() method is called once for each bean. Which statement is true about the two references returned? (Select one)

A) The two references refer to different instances of the same type
B) Both references refer to the same bean instance
C) One of the references will be null
D) A RuntimeException will be thrown when the ApplicationContext is initialized
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
9
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 foo;
C) Both a and b
D) Neither a or b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
10
import com.springsource.service.*; ... @Configuration public class AppConfig { @Bean public ClientService clientService() { return new ClientServiceImpl(); } } What is the id of the declared bean? (Select one)

A) clientService (starting with lower-case "c")
B) ClientService (starting with capital "C")
C) com.springsource.service.ClientService
D) com.springsource.service.ClientServiceImpl
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following statements is NOT true concerning Setter Injection or Constructor Injection? (Select one)

A) Constructor injection is useful when you must have an instance of a dependency class before your component is used
B) Setter injection is useful if a component can provide its own defaults
C) Using the @Autowired annotation, setter injection also works when the setter method is private
D) Using setters promotes immutability
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
12
Using Spring AOP, which of the following Spring annotations cause behavior to be added (select one)

A) @Secured
B) @Transactional
C) Both a and b
D) Neither a or b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following statements about Spring's JUnit integration testing support is true? (select one)

A) A new ApplicationContext is initialized and created for each test method
B) To obtain references to  the Spring bean(s) you want to test, you need to call getBean() on the ApplicationContext provided
C) You can indicate which XML configuration files the test class will use to create the ApplicationContext
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
14
What is true regarding bean definition inheritance?

A) Parent bean definitions should always be abstract
B) Parent bean definitions may be abstract
C) The class attribute can be declared in a parent bean definition
D) It is not useful to declare an id for a parent bean definition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
15
Consider the following complete configuration sample:
< bean class="rewards.internal.RewardNetworkImpl" >
< property name="accountRepository" ref="accountRepository" />
< /bean>
< bean class="rewards.internal.account.JdbcAccountRepository"/>
Which of the following statements is true? (Select one)

A) This configuration is correct
B) This configuration is not valid because the first bean should have an id. Its value should be "rewardNetwork".
C) This configuration is not valid because the second bean should have an id. Its value should be "accountRepository".
D) Both (b) and (c)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
16
@Configuration public class AppConfig {     @Bean     public ClientService clientService()
{         ClientServiceImpl clientService = new ClientServiceImpl();         
ClientService.addClientDao(new ClientDao());         
Return clientService;     }
In the example above, which statement is NOT true with regards to Spring Java configuration? (select one)

A) The declared bean is a singleton by default
B) This bean might be wrapped by a proxy
C) This bean cannot use a method starting with "add" to inject a dependency
D) The bean is of type ClientService
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
17
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 easier
B) The Spring Framework encourages you to program to interfaces which makes it easier to stub or mock out dependencies in your code
C) The extensive runtime checks performed by the ApplicationContext when it initializes make traditional unit testing less important
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
18
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 file
B) To reduce the amount of configuration required by inheriting properties from other bean definitions
C) To allow Spring beans to be created on the fly from classes declared as abstract
D) To simplify configuration by allowing multiple properties files to be loaded in a hierarchy to specify bean properties
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following statements about the @Autowired annotation is NOT true? (select one)

A) The default behavior is that if a dependency cannot be satisfied with @Autowired, the ApplicationContext will throw a RuntimeException
B) @Autowired is a Spring-specific annotation
C) Multiple arguments can be injected into a single method using @Autowired
D) It cannot be used to annotate fields, only constructors and methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following statements is NOT true concerning the BeanPostProcessor Extension point? (Select one)

A) BeanPostProcessors are called during the init phase
B) BeanPostProcessors are called after the dependencies have been injected
C) BeanPostProcessors are called before the BeanFactoryPostProcessors have been called
D) Custom BeanPostProcessors can be implemented
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following statements defines an "aspect"? (select one)

A) An encapsulation of advice combined with a pointcut.
B) A point in the execution of a program such as a method call or field assignment
C) An expression that selects one or more join points
D) Code to be executed at a join point that has been selected by a Pointcut
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
22
Consider the following bean definition Using Spring AOP, you have declared a Pointcut targeting all methods inside the clientService bean. ClientServiceImpl implements 3 different interfaces. Which interfaces will the proxy class implement? (Select one)

A) All interfaces
B) The proxy class does not implement any interface
C) A Spring bean should never implement any interface
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which statement concerning Aspect Oriented Programming (AOP) is true (Select one)

A) AOP modularizes cross-cutting concerns
B) Spring AOP implements aspects using the Proxy pattern
C) Three of the advice types are "before", "after" and "around"
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of these is NOT a characteristic of Spring JDBC? (Select one)

A) Can be configured exclusively using annotations
B) Provides a callback approach when greater developer control is needed
C) Connections are acquired and released from the DataSource automatically
D) Translation of root cause checked exceptions to Spring DataAccessExceptions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following statements is true with respect to Spring's support for Object-Relational Mapping (ORM) libraries (select one)

A) Spring supports management of Hibernate Sessions or JPA PersistenceContexts in combination with local transactions
B) Spring provides support for translating exceptions thrown from ORM libraries into Spring's own exception hierarchy
C) Spring provides FactoryBeans to configure each of the supported ORM libraries
D) All of the above is true
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
26
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 name
C) The target method may have several arguments
D) The return type must not be "void"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following statements is NOT a characteristic of Spring Transaction Management? (Select one)

A) It abstracts the differences between local and JTA transactions
B) It simplifies migration to distributed transactions
C) The use of JTA transactions is a requirement
D) Both declarative and programmatic transaction management is supported
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
28
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
29
Identify the correct statement(s) about the following pointcut expression: execution(* rewards.restaurant.*Service.find(..))

A) The target's type should end with "Service"
B) The target method name could be "findRestaurantById"
C) The target method should have one argument only
D) The target method may have several arguments
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
30
To register for a bean destruction callback, one can (Select one)

A) Decorate the destroy method with @PreDestroy
B) Decorate the destroy method with @PreDestroy and add a xml declaration
C) Set the bean instance in a "prototype" scope
D) Set the lazy-init attribute within the tag
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following statements is NOT true about Spring AOP? (Select one)

A) "private" methods cannot be advised, but all other method visibilities can be
B) Proxy classes are created at startup time by default
C) The "After Throwing" advice type executes after the join point, but executes only if the advised method threw an exception
D) The "After" advice type is invoked regardless of whether a method successfully returned or an exception is thrown
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following statements best describes the After Throwing advice type? (select one)

A) The advice is executed after a method invocation throws an exception
B) Custom processing can be performed before a join point executes
C) The advice is invoked only if the method returns successfully
D) The advice is designed to allow exceptions thrown from a join point to be caught and prevented from propagating up the stack
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which of the following statements about Pointcut expressions is true? (Select one)

A) A Pointcut can be defined either within annotations in Java code or within XML configuration
B) A pointcut expression can include operators such as the following: && (and),|| (or), ! (not)
C) A Pointcut expression can be used to select join points which have been annotated with a specific annotation
D) All of the above is true
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
34
Identify the correct statement(s) regarding the tag (Select one or multiple answers)

A) Can only be used with AspectJ (as opposed to Spring AOP)
B) Enables the detection of @Aspect annotated classes
C) Allows to define a list of names to include so Spring is not going to scan all the beans at startup
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
35
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which of the following statements is NOT true about advice types and exception handling?  (select one)

A) If a Before advice method throws an exception, the target method will not be called
B) An Around advice type can swallow, or halt the propagation of, an exception thrown by the target method.
C) An AfterReturning advice type can swallow, or halt the propagation of, an exception thrown by the target method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
37
Identify the correct statement(s) regarding the following pointcut: execution(@com.springsource.MyCustomAnnotation void *(..))

A) Spring does not support annotations inside its pointcut expression language
B) This will select join points representing void methods that are annotated by @com.springsource.MyCustomAnnotation
C) This will select join points representing methods that may have a public, protected or default visibility
D) This pointcut will in no situation ever be able to select any join points
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which statement best describes the advantage of using AfterReturning advice, rather than simply using after advice? (Select one)

A) If an exception is thrown in the join point, it is allowed to propagate, which is not the case with After advice
B) AfterReturning advice is invoked if an exception is thrown, which is not the case with After advice
C) After advice can only be applied to methods which are declared as void
D) AfterReturning advice is only invoked if the method returns successfully, allowing you to limit advice to only those scenarios
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
39
State which type of object the JdbcTemplate can be used to query (select one)

A) Simple types (int, long, String, etc)
B) Generic Maps
C) Domain Objects
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following statements is NOT true about advice types (select one)

A) The Before advice method is able to obtain information about the target method's return type
B) The After advice method is able to obtain information about the target method's return type
C) The Before advice method is able to obtain the target method's return value
D) The After advice method is able to obtain the target method's return value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
41
Security filters are used in Spring Security in which ways? (select one)

A) To drive authentication
B) To enforce authorization of web requests
C) To provide a logout capability
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
42
@Transactional(timeout=60) public class ClientServiceImpl implements ClientService { @Transactional(timeout=30) public void update1() {} } What timeout setting is applied to the timeout inside the update1 method? (Select one)

A) 60
B) 30
C) This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the class level
D) This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the method level
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
43
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
44
Which of the following statements is NOT true concerning Spring Remoting? (Select one)

A) Spring exporters handle the binding to a registry or exposing an endpoint
B) Spring provides FactoryBeans that generate proxies to handle client-side requirements
C) The client-side implementation must catch RemoteExceptions
D) Spring proxies convert RemoteExceptions to a runtime exception hierarchy
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
45
Which of the following statement(s) is/are true concerning Spring Transactions? (Select one or several answers)

A) Spring only provides support for declarative transaction management, there is no programmatic support
B) Spring provides declarative transactions only using XML
C) An AOP pointcut can be used to define which methods to advise for transactions
D) Spring's tx namespace enables a concise definition of transactional advice
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
46
Select which of the following is a mechanism which can be used with Spring Security to store user details (select one)

A) Database
B) LDAP
C) Properties file
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
47
In what order will these events occur during the initialization of the application? (Select one) Select the best response 1 Setter Dependency Injection 2 Bean constructor 3 call BeanFactoryPostProcessors 4 call BeanPostProcessors

A) 3, 2, 1, 4
B) 4, 2, 1, 3
C) 2, 1, 4, 3
D) 3, 1, 2, 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
48
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 to your XML configuration
C) Add to your XML configuration
D) Remove all other bean definitions from the XML configuration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
49
Consider the following Spring Security configuration       In order to access to "/accounts/editAccount.htm", what role is required? (select one)

A) ROLE_USER
B) ROLE_ADMIN
C) Both ROLE_USER and ROLE_ADMIN
D) No role is required
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
50
Which statement is NOT a characteristic of Spring's PlatformTransactionManager base interface (select one)

A) When declaring a PlatformTransactionManager implementation inside Spring configuration: as a requirement, the bean id should be "transactionManager"
B) The PlatformTransactionManager interface abstracts the differences between local and JTA transactions
C) There are various implementations of JTA transaction managers for different Java EE containers
D) PlatformTransactionManager is used in both declarative and programmatic transaction management
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
51
Which of the following statements about Spring @MVC is NOT true (select one)

A) Classes annotated with @Controller annotation can be detected by component scanning and loaded as Spring beans
B) Data can be passed from the controller to the view by use of the special Model parameter
C) Controllers are typically able to delegate to business methods in an application because a reference to a service bean can be injected into the controller
D) The DispatcherServlet, controller beans and other collaborators are all defined and configured in web.xml
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
52
Which statement is NOT true concerning Spring's RMI Proxy Generator (select one)

A) Spring provides a FactoryBean implementation that generates the RMI client-side proxy
B) The client-side proxy converts checked RemoteExceptions into Spring's runtime hierarchy of RemoteAccessExceptions
C) The proxy does not have to dynamically implement the interface of the remote service implementation
D) The client-side proxy contains all necessary information to connect to the remote service, such as the RMI Registry URL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
53
public class ClientServiceImpl implements ClientService { @Transactional(propagation=Propagation.REQUIRED) public void update1() { update2(); } @Transactional(propagation=Propagation.REQUIRES_NEW) public void update2() { // ... } You are using transactions with Spring AOP. What is happening when the update1 method is called? (Select one)

A) There is only one transaction because the call to update2() is internal (it does not go through the proxy)
B) There is only one transaction because REQUIRES_NEW runs into the active transaction if one already exists
C) There are 2 transactions because REQUIRES_NEW always runs in a new transaction
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which of the following methods is NOT provided by the JmsTemplate? (select one)

A) setDefaultDestination
B) onMessage (asynchronous call)
C) convertAndSend
D) receiveAndConvert (synchronous call)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
55
Consider the following Spring JMS configuration Which of the following statements is truE. (select one)

A) Spring will automatically receive messages from the order.queue.destination
B) The orderListener bean has to implement javax.jms.MessageListener or Spring's SessionAwareMessageListener interface
C) The application needs to run in an application server that provides a JMS implementation out of the box
D) Spring will automatically send a response message
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
56
Which of the following is a valid optional attribute for a transaction definition? (select one)

A) Propagation behavior
B) An isolation level
C) A read-only flag
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
57
Which of the following is NOT true about the @RequestMapping annotation?  (select one)

A) It is an annotation for mapping web requests to controller methods.
B) It is commonly used for component scanning purpose.
C) You can use it only with @Controller annotated classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.