Created
September 21, 2017 14:35
-
-
Save rfum/d9ba99ae0a4383103779bcaa66376847 to your computer and use it in GitHub Desktop.
Logging.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aspect; | |
import org.aspectj.lang.ProceedingJoinPoint; | |
import org.aspectj.lang.annotation.After; | |
import org.aspectj.lang.annotation.Around; | |
import org.aspectj.lang.annotation.Aspect; | |
@Aspect | |
public class Logging | |
{ | |
@Around("SystemArchitecture.allSetterPointcut()") | |
public void setterAroundAdvice( ProceedingJoinPoint joinPoint) | |
{ | |
try { | |
System.out.println("Target çalışmadan önce"); | |
joinPoint.proceed(); | |
System.out.println(joinPoint.toString()); | |
System.out.println("Target çalıştıktan sonra"); | |
} catch (Throwable throwable) { | |
throwable.printStackTrace(); | |
} | |
} | |
@After("SystemArchitecture.oneArgOnly(name)") | |
public void singleArgAdvice (String name) | |
{ | |
System.out.println(name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment