// Add mod_cluster-undertow integration service (jboss.modcluster.undertow) as a web deployment dependency
deploymentUnit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, UndertowEventHandlerAdapterBuilder.SERVICE_NAME);
// Request count wrapping
if (isMetricEnabled(RequestCountLoadMetric.class)) {
deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
return new RequestCountHttpHandler(handler);
}
});
}
// Bytes Sent wrapping
if (isMetricEnabled(SendTrafficLoadMetric.class)) {
deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
return new BytesSentHttpHandler(handler);
}
});
}
// Bytes Received wrapping
if (isMetricEnabled(ReceiveTrafficLoadMetric.class)) {
deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
return new BytesReceivedHttpHandler(handler);
}
});
}
// Busyness thread setup actions
if (isMetricEnabled(BusyConnectorsLoadMetric.class)) {
deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_OUTER_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
return new RunningRequestsHttpHandler(handler);
}
});