当前位置: 首页>>代码示例>>Java>>正文


Java HttpServerExchange.addExchangeCompleteListener方法代码示例

本文整理汇总了Java中io.undertow.server.HttpServerExchange.addExchangeCompleteListener方法的典型用法代码示例。如果您正苦于以下问题:Java HttpServerExchange.addExchangeCompleteListener方法的具体用法?Java HttpServerExchange.addExchangeCompleteListener怎么用?Java HttpServerExchange.addExchangeCompleteListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.undertow.server.HttpServerExchange的用法示例。


在下文中一共展示了HttpServerExchange.addExchangeCompleteListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
public void handleRequest(final HttpServerExchange exchange, final HttpHandler next) throws Exception {
    long oldVal, newVal;
    do {
        oldVal = state;
        final long current = oldVal & MASK_CURRENT;
        final long max = (oldVal & MASK_MAX) >> 32L;
        if (current >= max) {
            exchange.dispatch(SameThreadExecutor.INSTANCE, new Runnable() {
                @Override
                public void run() {
                    if (!queue.offer(new SuspendedRequest(exchange, next))) {
                        Connectors.executeRootHandler(failureHandler, exchange);
                    }
                }
            });
            return;
        }
        newVal = oldVal + 1;
    } while (!stateUpdater.compareAndSet(this, oldVal, newVal));
    exchange.addExchangeCompleteListener(COMPLETION_LISTENER);
    next.handleRequest(exchange);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:RequestLimit.java

示例2: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
    exchange.putAttachment(SessionManager.ATTACHMENT_KEY, sessionManager);
    exchange.putAttachment(SessionConfig.ATTACHMENT_KEY, sessionConfig);
    final UpdateLastAccessTimeListener handler = new UpdateLastAccessTimeListener(sessionConfig, sessionManager);
    exchange.addExchangeCompleteListener(handler);
    next.handleRequest(exchange);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:SessionAttachmentHandler.java

示例3: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    activeRequestsUpdater.incrementAndGet(this);
    if (shutdown) {
        decrementRequests();
        exchange.setResponseCode(StatusCodes.SERVICE_UNAVAILABLE);
        exchange.endExchange();
        return;
    }
    exchange.addExchangeCompleteListener(listener);
    next.handleRequest(exchange);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:GracefulShutdownHandler.java

示例4: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
    exchange.addExchangeCompleteListener(exchangeCompletionListener);
    next.handleRequest(exchange);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AccessLogHandler.java

示例5: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    exchange.addExchangeCompleteListener(exchangeCompletionListener);
    next.handleRequest(exchange);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:JDBCLogHandler.java


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