• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AttachmentKey类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中io.undertow.util.AttachmentKey的典型用法代码示例。如果您正苦于以下问题:Java AttachmentKey类的具体用法?Java AttachmentKey怎么用?Java AttachmentKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AttachmentKey类属于io.undertow.util包,在下文中一共展示了AttachmentKey类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addToAttachmentList

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> void addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value) {

    if (key == null) {
        throw UndertowMessages.MESSAGES.argumentCannotBeNull("key");
    }
    final Map<AttachmentKey<?>, Object> attachments = this.attachments;
    synchronized (attachments) {
        final List<T> list = key.cast(attachments.get(key));
        if (list == null) {
            final AttachmentList<T> newList = new AttachmentList<T>((Class<T>) Object.class);
            attachments.put(key, newList);
            newList.add(value);
        } else {
            list.add(value);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:SpdyChannel.java


示例2: testNotOverride

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Test
public void testNotOverride() throws Exception {
	HttpServerExchange exchange = new MockUp<HttpServerExchange>() {
		@Mock
		public HeaderMap getRequestHeaders() {
			throw new AssertionError();
		}

		@Mock
		public <T> T getAttachment(final AttachmentKey<T> key) {
			throw new AssertionError();
		}
	}.getMockInstance();

	exchange.setRequestMethod(Methods.GET);

	this.target.handleRequest(exchange);
}
 
开发者ID:taichi,项目名称:siden,代码行数:19,代码来源:MethodOverrideHandlerTest.java


示例3: getAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T getAttachment(AttachmentKey<T> key) {
    if (key == null) {
        throw UndertowMessages.MESSAGES.argumentCannotBeNull("key");
    }
    return (T) attachments.get(key);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:SpdyChannel.java


示例4: getAttachmentList

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> List<T> getAttachmentList(AttachmentKey<? extends List<T>> key) {
    if (key == null) {
        throw UndertowMessages.MESSAGES.argumentCannotBeNull("key");
    }
    Object o = attachments.get(key);
    if(o == null) {
        return Collections.emptyList();
    }
    return (List)o;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SpdyChannel.java


示例5: putAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T putAttachment(AttachmentKey<T> key, T value) {
    if (key == null) {
        throw UndertowMessages.MESSAGES.argumentCannotBeNull("key");
    }
    return key.cast(attachments.put(key, key.cast(value)));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:SpdyChannel.java


示例6: ChunkReader

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
public ChunkReader(final Attachable attachable, final AttachmentKey<HeaderMap> trailerAttachmentKey, ConduitListener<? super T> finishListener, T conduit) {
    this.attachable = attachable;
    this.trailerAttachmentKey = trailerAttachmentKey;
    this.finishListener = finishListener;
    this.conduit = conduit;
    this.state = FLAG_READING_LENGTH;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ChunkReader.java


示例7: putAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> void putAttachment(final AttachmentKey<T> key, final T value) {
    exchange.putAttachment(key, value);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ServletWebSocketHttpExchange.java


示例8: getAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T getAttachment(final AttachmentKey<T> key) {
    return exchange.getAttachment(key);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ServletWebSocketHttpExchange.java


示例9: removeAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T removeAttachment(AttachmentKey<T> key) {
    return key.cast(attachments.remove(key));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyChannel.java


示例10: addToAttachmentList

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> void addToAttachmentList(AttachmentKey<AttachmentList<T>> key, T value) {
    channel.addToAttachmentList(key, value);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyServerConnection.java


示例11: removeAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T removeAttachment(AttachmentKey<T> key) {
    return channel.removeAttachment(key);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyServerConnection.java


示例12: putAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T putAttachment(AttachmentKey<T> key, T value) {
    return channel.putAttachment(key, value);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyServerConnection.java


示例13: getAttachmentList

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> List<T> getAttachmentList(AttachmentKey<? extends List<T>> key) {
    return channel.getAttachmentList(key);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyServerConnection.java


示例14: getAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
@Override
public <T> T getAttachment(AttachmentKey<T> key) {
    return channel.getAttachment(key);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SpdyServerConnection.java


示例15: AttachmentHandler

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
public AttachmentHandler(final AttachmentKey<T> key, final HttpHandler next, final T instance) {
    this.next = next;
    this.key = key;
    this.instance = instance;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AttachmentHandler.java


示例16: putAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
<T> void putAttachment(final AttachmentKey<T> key, T value); 
开发者ID:lamsfoundation,项目名称:lams,代码行数:2,代码来源:WebSocketHttpExchange.java


示例17: getAttachment

import io.undertow.util.AttachmentKey; //导入依赖的package包/类
<T> T getAttachment(final AttachmentKey<T> key); 
开发者ID:lamsfoundation,项目名称:lams,代码行数:2,代码来源:WebSocketHttpExchange.java



注:本文中的io.undertow.util.AttachmentKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MetricsIntValue类代码示例发布时间:2022-05-21
下一篇:
Java FailureStrategy类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap