mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-21 11:29:38 +00:00
isEnabled -> enabled
This commit is contained in:
parent
d58d6176a2
commit
fa1e1a8f86
1 changed files with 4 additions and 4 deletions
|
@ -36,7 +36,7 @@ import org.springframework.util.StopWatch;
|
||||||
@Aspect
|
@Aspect
|
||||||
public class CallMonitoringAspect {
|
public class CallMonitoringAspect {
|
||||||
|
|
||||||
private boolean isEnabled = true;
|
private boolean enabled = true;
|
||||||
|
|
||||||
private int callCount = 0;
|
private int callCount = 0;
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@ public class CallMonitoringAspect {
|
||||||
|
|
||||||
@ManagedAttribute
|
@ManagedAttribute
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
isEnabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ManagedAttribute
|
@ManagedAttribute
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return isEnabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ManagedOperation
|
@ManagedOperation
|
||||||
|
@ -72,7 +72,7 @@ public class CallMonitoringAspect {
|
||||||
|
|
||||||
@Around("within(@org.springframework.stereotype.Repository *)")
|
@Around("within(@org.springframework.stereotype.Repository *)")
|
||||||
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
if (this.isEnabled) {
|
if (this.enabled) {
|
||||||
StopWatch sw = new StopWatch(joinPoint.toShortString());
|
StopWatch sw = new StopWatch(joinPoint.toShortString());
|
||||||
|
|
||||||
sw.start("invoke");
|
sw.start("invoke");
|
||||||
|
|
Loading…
Reference in a new issue