Alternative annotative way to specify precedence of aspects?
1.@Order
2.@Aspect
3.@PointCut
4.none of the mentioned
Expressions which returns Parameters of pointcuts?
1. target
2.args
3.none of the mentioned
4.all of the mentioned
How to introduce counter field to original bean class?
1.Using Spring AOP
2. Implementing interface
3.AspectJ Pointcut
4. None of the mentioned
In introduction advice you have to modify class to introduce new methods
1.True
2.False
3.error
4.None of these
Introduction advice helps in implementing multiple inheritance
1.True
2.False
3.error
4.None of these
Pointcuts can be composed using:-
1.org.springframework.aop.support.Pointcuts class
2.composablePointcut class
3.all of the mentioned
4.none of the mentioned
Tag used to declare aspects
1.aop:config
2.aop:auto-proxy
3.aop:autowire
4.None of the mentioned
Which interface is used to listen to certain events
1. ApplicationListener
2.ContextListener
3.EventListener
4.none of the mentioned
Which method provided by ExecutorService is used to check whether job is finished or cancelled
1.Future.isDone()
2.Future.isCancelled()
3. None of the mentioned
4.all of the mentioned
Annotation used to declare an introduction
1.Before
2. After
3.@DeclareParents
4.none of the mentioned
Annotation used to refer poincuts?
1.@Pointcut
2.@PointcutExecution
3.@PointcutBefore
4.none of the mentioned
Are logical operators valid in pointcut expressions?
1.Yes
2.No
3.error
4.none of the mentioned
Attribute used to specify implementation class
1. no such attribute
2.defaultImpl
3. defaultInterface
4.defaultImplement
For a property editor to be searched correctly, it must be located in the same package as the target class, and the name must be Editor’s name
1. True
2.False
3.error
4.None of these
How does an Introduction advice do this in Spring?
1.dynamic proxy
2. web proxy
3.implements org.springframework.net.bundle interface
4.none of the mentioned
How to keep track of the usage of your beans
1.Calling Count
2. Last modified date
3.New Interface to your object
4. All of the mentioned
Is the following pointcut expression correct? execution(* ArithmeticCalculator.*(..))
1. Yes
2.No
3.If every target class is in same package
4.Depends where target class is located
Language used to set various kinds of join points
1.AspectJ pointcut language
2. Java pointcut language
3.XML pointcut language
4. None of the mentioned
Method provided by ExectuorService which returns a Future < T >
1. submit
2.publish
3. addService
4.registerService
Method that converts string into a property value
1. getAsText
2. setAsText
3.regText
4.none of the mentioned
Method which checks if all target classes are matched
1.matches()
2.pair()
3.matchTargetClass()
4.none of the mentioned
Method which converts property into a string value
1.getAsText
2. setAsText
3.regText
4.none of the mentioned
Method which returns the highest priority of aspect’s join point?
1.getHighestPriority
2.getOrder
3.getHighOrder
4. getPriority
Pointcut used to parse an AspectJ pointcut expression string
1.org.springframework.aop.aspectj.AspectJExpressionPointcut
2.org.springframework.aop.aspectj.AspectJExpressionPointcutString
3. org.springframework.aop.aspectj.AspectJExpressionString
4.org.springframework.aop.aspectj.AspectJPointcuttoString
Spring supports operations on pointcuts:-
1. notably
2.union
3.intersection
4.all of the mentioned
Tag used to enable AspectJ annotation?
1.Introduction
2.aop:aspectj-autowire
3.aop:aspectj-autoproxy
4.AfterSpecial
Tag which defined Spring AOP configurations
1. aop:config
2.aop:configregister
3. aop:configbeans
4.none of the mentioned
The property value is retrieved by:-
1.getValue method
2.setValue method
3.none of the mentioned
4. All of the mentioned
What are the ways to create custom Property Editors?
1. implement PropertyEditor interface
2. extend PropertyEditorSupport Class
3.none of the mentioned
4. All of the mentioned
What will be the output of the code snippet?
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.AfterThrowing;
@Aspect
public class AfterThrowingExample
{
@AfterThrowing(
pointcut="com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
throwing="ex")
public void doRecoveryActions(DataAccessException e)
{
throw new IllegalArgumentException();
// ...
}
}1. Runtime Error
2.IllegalArgumentException
3.BeanCreation Exception
4.none of the mentioned
Which advice combines all advices into one?
1.@Before
2.@After
3. @AfterThrowing
4.none of the mentioned
Which advice is executed once a joint point finishes?
1.@Before
2.@After
3.@AfterReturning
4. @AfterThrowing
Which advice is executed only when joint point returns or throws an exception?
1. @Before
2.@After
3. @AfterReturning
4. @AfterThrowing
Which event is provoked when web request comes into action
1. ContextClosedEvent
2. ContextStoppedEvent
3.SessionEvent
4.RequestHandledEvent
Which instantiation model is supported by AspectJ?
1.perthis
2. pertarget
3.none of the mentioned
4.all of the mentioned
Which interface is implemented to specify precedence of aspects?
1. Ordered
2.ApplicationAspect
3.AspectPointcut
4.none of the mentioned
Which interface is used to create your own property editors?
1.CustomEditorConfigurer
2.RegisterCustomEditor
3.PropertyEditorConfigurer
4.none of the mentioned
Which method is used to publish your own custom event
1. contextPublish
2. publishEvent
3.applicationEventPublish
4.addEvent
Which of the following class’s instance is used by TimerTaskExecutor for managing jobs
1.java.util.Timer
2. java.util.Date
3. java.util.HashMap
4.none of the mentioned
Which of the following is a well known recognized event
1.ContextCloasedEvemt
2.ContextRefreshedEvent
3. RequestHandledEvent
4. All of the mentioned
Which of the following is advice supported by Aspect Annotation?
1.@Before
2.@After
3. @AfterReturning
4.all of the mentioned
Which of the following is used to convert property values to text Values?
1. property Editor
2. property setter
3. property getter
4.none of the mentioned
Which of the following pattern is used to match bean name?
1. bean(*Calculator)
2.bean(Calculator)
3.bean(com.appress.spring.Calculator)
4. None of the mentioned
Which of the following property editors are registered by Spring?
1. CustomNumberEditor
2.FileEditor
3.CustomDateEditor
4.CustomNetEditor
Which package is used for periodic work
1. java.lang.Thread
2. java.util.TimerTask
3. java.util.Timer
4. java.util.concurrent
Which property editor is used to specify a URL String for a property of the URL type?
1. java.net.*
2. java.io.*
3.java.net.URL
4. None of the mentioned
Which special type of advice is used to implement an interface?
1. Introduction
2.Before
3. After
4.AfterSpecial
Which subinterface provides functionality for managing Threads and their events
1.ExecutorService
2.ThreadService
3.All of the mentioned
4.none of the mentioned
Which tag in XML is used to declare @Before advice’s method?
1.aop:before
2.aop:after
3.aop:afterthrow
4.none of the mentioned
Which tag informs the spring container about the use of AspectJ annotation?
1.aop:aspectj-autowire
2.aop:aspectj-name
3. aop:aspectj-autoproxy
4.none of the mentioned