[JAVA] spring framework Simple study memo (2): AOP

spring framework Simple study memo (2): AOP

Essence

--Separate scattered code from essential processing

Way of thinking

--Implementing scattered processing across

Typical application scene

--Log output --Security check --Transaction --Cashew --Monitoring --Exception handling

Source example

@Aspect
@Component
public class MethodStartLoggingAspect {
    @Before("execution(* *..*ServiceImpl.*(..))")
    public void startLog(JoinPoint jp) {
        System.out.println("Method start:" + jp.getSignature());
    }
}

Advice implementation method

point cut formula

--How to select a join point --Example: "execution (* * .. * ServiceImpl. * (..))" --Specified method --Method specification --Class type specification --Other specifications such as name

AOP regular annotation

--Transaction

Recommended Posts

spring framework Simple study memo (2): AOP
spring framework Simple study memo (1): ApplicationContext, Bean, Autowired
Play Framework Study Memo Database ①
Spring Framework self-study memo series_1
Play Framework Study Memo Database ②Read
Spring Framework study notes [Part 1] DI container
Spring retrospective memo
About Spring AOP
About spring AOP
Play Framework study
[Memo] JSUG Study Group 2020 Part 1 Spring x Kotlin
[Spring Framework] Configuration split
JJUG CCC Spring 2018 memo
Spring Framework multilingual support
1. Start Spring framework from 1
Spring Shell usage memo
Spring boot memo writing (1)
[Java ~ Method ~] Study memo (5)
About Spring AOP Pointcut
Dot installation study memo 01
[Java ~ Array ~] Study memo 4
Spring boot memo writing (2)
Overview of Spring AOP
[Memo] JSUG Study Group 2019 Part 7 Utilization of Spring in Visional
Ruby study memo (conditional branching)
Spring Security usage memo CSRF
About Spring Framework context error
Spring Security usage memo Run-As
Java Silver Study Method Memo
[Java ~ Boolean value ~] Study memo (2)
Introduction to JUnit (study memo)
Spring Security Usage memo Method security
Spring Security usage memo Remember-Me
Introduction to Spring Boot ② ~ AOP ~
[Java] Spring AOP execution order
Java study memo 2 with Progate
Ruby study memo (recursive function)
Spring Security usage memo CORS
Spring Security usage memo test
[Ruby ~ Iterative processing ~] Study memo 4
Spring boot controller method memo