com.minlia.rocket.data.batis.interceptor.CreatedMethodInterceptor Maven / Gradle / Ivy
package com.minlia.rocket.data.batis.interceptor;
import com.minlia.rocket.data.batis.event.publisher.AfterCreatedEventPublisher;
import com.minlia.rocket.data.batis.event.publisher.BeforeCreatedEventPublisher;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author will
*
*
*/
public class CreatedMethodInterceptor implements MethodInterceptor {
@Autowired
private AfterCreatedEventPublisher afterCreatedEventPublisher;
@Autowired
private BeforeCreatedEventPublisher beforeCreatedEventPublisher;
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
beforeCreatedEventPublisher.publish(this);
Object ret = invocation.proceed();
afterCreatedEventPublisher.publish(this);
return ret;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy