@ConditionalOnMissingBean(name = {DruidStatProperties.DRUID_STAT_INTERCEPTOR_NAME})
@Bean(DruidStatProperties.DRUID_STAT_INTERCEPTOR_NAME)
public Interceptor druidStatInterceptor() {
return new DruidStatInterceptor();
}
java类org.aopalliance.intercept.Interceptor的实例源码
DruidStatInitAutoConfiguration.java 文件源码
项目:druid-boot-starter
阅读 17
收藏 0
点赞 0
评论 0
AnnotationInterceptionService.java 文件源码
项目:dropwizard-hk2
阅读 21
收藏 0
点赞 0
评论 0
protected <T extends Executable, I extends Interceptor, F> List<I> getInterceptors(
T interceptee,
IterableProvider<? extends F> factoryProviders,
Class<F> interceptorType,
InterceptorFactory<F, T, Annotation, I> interceptorProvider
) {
List<I> interceptors = Lists.newArrayList();
factoryProviders.handleIterator().forEach(handle -> {
// Make sure descriptor is fully reified
ActiveDescriptor<?> descriptor = handle.getActiveDescriptor();
if (!descriptor.isReified()) {
descriptor = locator.reifyDescriptor(descriptor);
}
// Check the type of annotation supported by the factory
for (Type contract : descriptor.getContractTypes()) {
if (ReflectionHelper.getRawClass(contract) == interceptorType) {
Class<? extends Annotation> annotationClass = (Class<? extends Annotation>) ReflectionHelper.getRawClass(
ReflectionHelper.getFirstTypeArgument(contract));
// Might be Object.class if getRawClass found an unbound type variable or wildcard
if (!Annotation.class.isAssignableFrom(annotationClass)) {
log.warn("Unable to determine annotation binder from contract type {}", annotationClass);
return;
}
Annotation ann = interceptee.getAnnotation(annotationClass);
if (ann == null) {
ann = interceptee.getDeclaringClass().getAnnotation(annotationClass);
}
if (ann != null) {
// Create the factory and produce an interceptor
F factory = handle.getService();
I interceptor = interceptorProvider.apply(factory, interceptee, ann);
if (interceptor != null) {
interceptors.add(interceptor);
}
}
return;
}
}
});
return interceptors;
}
JpaInterceptorTests.java 文件源码
项目:class-guard
阅读 19
收藏 0
点赞 0
评论 0
public Interceptor getInterceptor(int i) {
return null;
}
JdoInterceptorTests.java 文件源码
项目:class-guard
阅读 20
收藏 0
点赞 0
评论 0
public Interceptor getInterceptor(int i) {
return null;
}
ProxyFactory.java 文件源码
项目:lams
阅读 29
收藏 0
点赞 0
评论 0
/**
* Create a new ProxyFactory for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
*/
public ProxyFactory(Class<?> proxyInterface, Interceptor interceptor) {
addInterface(proxyInterface);
addAdvice(interceptor);
}
ProxyFactory.java 文件源码
项目:lams
阅读 28
收藏 0
点赞 0
评论 0
/**
* Create a new proxy for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
* @return the proxy object
* @see #ProxyFactory(Class, org.aopalliance.intercept.Interceptor)
*/
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, Interceptor interceptor) {
return (T) new ProxyFactory(proxyInterface, interceptor).getProxy();
}
ProxyFactory.java 文件源码
项目:spring4-understanding
阅读 33
收藏 0
点赞 0
评论 0
/**
* Create a new ProxyFactory for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
*/
public ProxyFactory(Class<?> proxyInterface, Interceptor interceptor) {
addInterface(proxyInterface);
addAdvice(interceptor);
}
ProxyFactory.java 文件源码
项目:spring4-understanding
阅读 33
收藏 0
点赞 0
评论 0
/**
* Create a new proxy for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
* @return the proxy object
* @see #ProxyFactory(Class, org.aopalliance.intercept.Interceptor)
*/
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, Interceptor interceptor) {
return (T) new ProxyFactory(proxyInterface, interceptor).getProxy();
}
ProxyFactory.java 文件源码
项目:spring
阅读 34
收藏 0
点赞 0
评论 0
/**
* Create a new ProxyFactory for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
*/
public ProxyFactory(Class<?> proxyInterface, Interceptor interceptor) {
addInterface(proxyInterface);
addAdvice(interceptor);
}
ProxyFactory.java 文件源码
项目:spring
阅读 32
收藏 0
点赞 0
评论 0
/**
* Create a new proxy for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
* @return the proxy object
* @see #ProxyFactory(Class, org.aopalliance.intercept.Interceptor)
*/
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, Interceptor interceptor) {
return (T) new ProxyFactory(proxyInterface, interceptor).getProxy();
}
ProxyFactory.java 文件源码
项目:class-guard
阅读 33
收藏 0
点赞 0
评论 0
/**
* Create a new ProxyFactory for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
*/
public ProxyFactory(Class<?> proxyInterface, Interceptor interceptor) {
addInterface(proxyInterface);
addAdvice(interceptor);
}
ProxyFactory.java 文件源码
项目:class-guard
阅读 29
收藏 0
点赞 0
评论 0
/**
* Create a new proxy for the given interface and interceptor.
* <p>Convenience method for creating a proxy for a single interceptor,
* assuming that the interceptor handles all calls itself rather than
* delegating to a target, like in the case of remoting proxies.
* @param proxyInterface the interface that the proxy should implement
* @param interceptor the interceptor that the proxy should invoke
* @return the proxy object
* @see #ProxyFactory(Class, org.aopalliance.intercept.Interceptor)
*/
@SuppressWarnings("unchecked")
public static <T> T getProxy(Class<T> proxyInterface, Interceptor interceptor) {
return (T) new ProxyFactory(proxyInterface, interceptor).getProxy();
}