Function: Around()
Less than 1 minute
AspectJS • Docs
Function: Around()
Around(...
args
):MethodDecorator
Annotation to declare an advice to be applied around a method.
The Around annotation is used to apply around advice to a method. Around advice is executed before and after the target method's execution. It allows full control over the method's execution by intercepting the method invocation. It is commonly used for method interception, performance monitoring, or transaction management.
Parameters
• ...args: PointcutExpression
<PointcutKind
>[]
Returns
MethodDecorator
An ES decorator representing the Around annotation.
Example
import { Around, on } from '@aspectjs/core';
class MyClass {
@Around(on.classes.withAnnotations(SomeAnnotation))
applyAroundAdvice(ctxt: AroundContext) {
// Method implementation
}
}
Defined in
packages/core/src/advices/around/around.annotation.ts:29