All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.chobit.spring.autoconfigure.log.QuickLogInterceptor Maven / Gradle / Ivy

The newest version!
package org.chobit.spring.autoconfigure.log;

import org.chobit.spring.common.OperationInvoker;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import java.io.Serializable;


/**
 * TraceClew Interceptor
 *
 * @author robin
 */
public class QuickLogInterceptor extends QuickLogAspectSupport implements MethodInterceptor, Serializable {


    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {

        OperationInvoker invoker = () -> {
            try {
                return invocation.proceed();
            } catch (Throwable t) {
                throw new OperationInvoker.WrappedThrowableException(t);
            }
        };


        try {
            return execute(invoker, invocation.getThis(), invocation.getMethod(), invocation.getArguments());
        } catch (OperationInvoker.WrappedThrowableException wte) {
            throw wte.getOriginal();
        }

    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy