Java Code Examples for org.aspectj.lang.ProceedingJoinPoint#toShortString()

The following examples show how to use org.aspectj.lang.ProceedingJoinPoint#toShortString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CallMonitoringAspect.java    From java-microservice with MIT License 6 votes vote down vote up
@Around("@annotation(com.apssouza.monitoring.Monitored)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
    System.out.println("callend");
    Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
    if (this.enabled) {
        StopWatch sw = new StopWatch(joinPoint.toShortString());

        sw.start("invoke");
        try {
            return joinPoint.proceed();
        } finally {
            sw.stop();
            synchronized (this) {
                this.callCount++;
                this.accumulatedCallTime += sw.getTotalTimeMillis();
            }
            publisher.publishEvent(new MonitoringInvokedEvent(
                    method.getName(),
                    this.accumulatedCallTime
            ));
        }
    } else {
        return joinPoint.proceed();
    }
}
 
Example 2
Source File: CallMonitoringAspect.java    From DevOps-for-Web-Development with MIT License 6 votes vote down vote up
@Around("within(@org.springframework.stereotype.Repository *)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
    if (this.enabled) {
        StopWatch sw = new StopWatch(joinPoint.toShortString());

        sw.start("invoke");
        try {
            return joinPoint.proceed();
        } finally {
            sw.stop();
            synchronized (this) {
                this.callCount++;
                this.accumulatedCallTime += sw.getTotalTimeMillis();
            }
        }
    } else {
        return joinPoint.proceed();
    }
}
 
Example 3
Source File: CallMonitoringAspect.java    From DevOps-for-Web-Development with MIT License 6 votes vote down vote up
@Around("within(@org.springframework.stereotype.Repository *)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
    if (this.enabled) {
        StopWatch sw = new StopWatch(joinPoint.toShortString());

        sw.start("invoke");
        try {
            return joinPoint.proceed();
        } finally {
            sw.stop();
            synchronized (this) {
                this.callCount++;
                this.accumulatedCallTime += sw.getTotalTimeMillis();
            }
        }
    } else {
        return joinPoint.proceed();
    }
}
 
Example 4
Source File: CallMonitoringAspect.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Around("within(@org.springframework.stereotype.Service *)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
	if (this.isEnabled) {
		StopWatch sw = new StopWatch(joinPoint.toShortString());

		sw.start("invoke");
		try {
			return joinPoint.proceed();
		}
		finally {
			sw.stop();
			synchronized (this) {
				this.callCount++;
				this.accumulatedCallTime += sw.getTotalTimeMillis();
			}
		}
	}

	else {
		return joinPoint.proceed();
	}
}
 
Example 5
Source File: CallMonitoringAspect.java    From docker-workflow-plugin with MIT License 6 votes vote down vote up
@Around("within(@org.springframework.stereotype.Repository *)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
    if (this.enabled) {
        StopWatch sw = new StopWatch(joinPoint.toShortString());

        sw.start("invoke");
        try {
            return joinPoint.proceed();
        } finally {
            sw.stop();
            synchronized (this) {
                this.callCount++;
                this.accumulatedCallTime += sw.getTotalTimeMillis();
            }
        }
    } else {
        return joinPoint.proceed();
    }
}
 
Example 6
Source File: CallMonitoringAspect.java    From audit4j-demo with Apache License 2.0 6 votes vote down vote up
@Around("within(@org.springframework.stereotype.Repository *)")
public Object invoke(ProceedingJoinPoint joinPoint) throws Throwable {
    if (this.enabled) {
        StopWatch sw = new StopWatch(joinPoint.toShortString());

        sw.start("invoke");
        try {
            return joinPoint.proceed();
        } finally {
            sw.stop();
            synchronized (this) {
                this.callCount++;
                this.accumulatedCallTime += sw.getTotalTimeMillis();
            }
        }
    } else {
        return joinPoint.proceed();
    }
}