private <T> Supplier<T> createHandlerBeanSupplier(final T h, final Class<? extends T> handlerClass,
final String beanName) {
final ChannelHandler.Sharable sharable = findAnnotation(handlerClass, ChannelHandler.Sharable.class);
if (sharable == null) {
final Scope scope = findAnnotation(handlerClass, Scope.class);
if ((scope == null) || !ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals(scope.value())) {
throw new IllegalStateException("Non-sharable handler should be presented by a " +
"prototype bean");
}
}
return (sharable == null) ?
() -> beanFactory.getBean(beanName, handlerClass) :
() -> h;
}
SpringNettyConfiguration.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:spring-boot-netty
作者:
评论列表
文章目录