Search in sources :

Example 1 with HttpManagement

use of org.jboss.as.server.mgmt.domain.HttpManagement in project wildfly by wildfly.

the class ConsoleRedirectService method start.

@Override
public void start(final StartContext startContext) throws StartException {
    final Host host = hostInjector.getValue();
    UndertowLogger.ROOT_LOGGER.debugf("Starting console redirect for %s", host.getName());
    final HttpManagement httpManagement = httpManagementInjector.getOptionalValue();
    if (httpManagement != null) {
        if (httpManagement.hasConsole()) {
            host.registerHandler(CONSOLE_PATH, new ConsoleRedirectHandler(httpManagement));
        } else {
            host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE));
        }
    } else {
        host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE));
    }
}
Also used : RedirectHandler(io.undertow.server.handlers.RedirectHandler) HttpManagement(org.jboss.as.server.mgmt.domain.HttpManagement)

Aggregations

RedirectHandler (io.undertow.server.handlers.RedirectHandler)1 HttpManagement (org.jboss.as.server.mgmt.domain.HttpManagement)1