Skip to content

Document that pertypewithin is supported by Spring AOP #25887

@dngzs

Description

@dngzs

I can write like this.

@Component
@Aspect("pertypewithin(com..*)")
@Scope("prototype")
public class TimeAspect {
 
    @Pointcut("execution(* com.dngzs.spring.service..*.*(..))")
    public void time() {
    }

    @Before("time()")
    public void before(JoinPoint joinpoint) {
        System.out.println("before:" + joinpoint);
    }
}

The official document is written like this:

Spring supports AspectJ’s perthis and pertarget instantiation models; percflow, percflowbelow, and pertypewithin are not currently supported.

Is my example wrong?

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions