use of io.undertow.server.HttpHandler in project wildfly by wildfly.
the class ModClusterUndertowDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// 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);
}
});
}
}
use of io.undertow.server.HttpHandler in project wildfly by wildfly.
the class UndertowHostTestCase method findContext.
@Test
public void findContext() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);
when(deployment.getDeploymentInfo()).thenReturn(info);
this.undertowHost.registerDeployment(deployment, handler);
Context result = this.host.findContext(expectedPath);
assertSame(this.host, result.getHost());
assertSame(expectedPath, result.getPath());
result = this.host.findContext("unknown");
assertNull(result);
}
use of io.undertow.server.HttpHandler in project wildfly by wildfly.
the class UndertowHostTestCase method getContexts.
@Test
public void getContexts() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);
when(deployment.getDeploymentInfo()).thenReturn(info);
this.undertowHost.registerDeployment(deployment, handler);
Iterator<Context> result = this.host.getContexts().iterator();
assertTrue(result.hasNext());
Context context = result.next();
assertSame(this.host, context.getHost());
assertSame(expectedPath, context.getPath());
assertFalse(result.hasNext());
}
use of io.undertow.server.HttpHandler in project cxf by apache.
the class UndertowBasicAuthHandler method buildSecurityHandler.
private void buildSecurityHandler() {
HttpHandler handler = this.next;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
}
use of io.undertow.server.HttpHandler in project cxf by apache.
the class UndertowDigestAuthHandler method buildSecurityHandler.
private void buildSecurityHandler() {
HttpHandler handler = this.next;
handler = new AuthenticationCallHandler(handler);
handler = new AuthenticationConstraintHandler(handler);
final List<AuthenticationMechanism> mechanisms = Collections.<AuthenticationMechanism>singletonList(new DigestAuthenticationMechanism("WSRealm", "WSDomain", "DIGEST", this.identityManager));
handler = new AuthenticationMechanismsHandler(handler, mechanisms);
this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
}
Aggregations