本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: handleRequest
import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
exchange.addExchangeCompleteListener(exchangeCompletionListener);
next.handleRequest(exchange);
}
示例5: handleRequest
import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
exchange.addExchangeCompleteListener(exchangeCompletionListener);
next.handleRequest(exchange);
}