WebsocketBundle.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:dropwizard-websockets 作者:
public void addEndpoint(Class<?> clazz) {
    ServerEndpoint anno = clazz.getAnnotation(ServerEndpoint.class);
    if(anno == null){
        throw new RuntimeException(clazz.getCanonicalName()+" does not have a "+ServerEndpoint.class.getCanonicalName()+" annotation");
    }
    ServerEndpointConfig.Builder bldr =  ServerEndpointConfig.Builder.create(clazz, anno.value());
    if(defaultConfigurator != null){
        bldr = bldr.configurator(defaultConfigurator);
    }
    endpointConfigs.add(bldr.build());
    if (starting)
        throw new RuntimeException("can't add endpoint after starting lifecycle");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号