use of org.wildfly.extension.undertow.deployment.GateHandlerWrapper in project wildfly by wildfly.
the class Host method start.
@Override
public void start(StartContext context) throws StartException {
ControlledProcessStateService controlledProcessStateService = controlledProcessStateServiceInjectedValue.getValue();
//may be null for tests
if (controlledProcessStateService != null && controlledProcessStateService.getCurrentState() == ControlledProcessState.State.STARTING) {
gateHandlerWrapper = new GateHandlerWrapper();
controlledProcessStateService.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
controlledProcessStateService.removePropertyChangeListener(this);
if (gateHandlerWrapper != null) {
gateHandlerWrapper.open();
gateHandlerWrapper = null;
}
rootHandler = null;
}
});
}
server.getValue().registerHost(this);
UndertowLogger.ROOT_LOGGER.hostStarting(name);
}
use of org.wildfly.extension.undertow.deployment.GateHandlerWrapper in project wildfly by wildfly.
the class Host method configureRootHandler.
private HttpHandler configureRootHandler() {
AccessLogService logService = accessLogService;
HttpHandler rootHandler = pathHandler;
ArrayList<UndertowFilter> filters = new ArrayList<>(this.filters);
//handle options * requests
rootHandler = new OptionsHandler(rootHandler);
//handle requests that use the Expect: 100-continue header
rootHandler = Handlers.httpContinueRead(rootHandler);
rootHandler = LocationService.configureHandlerChain(rootHandler, filters);
if (logService != null) {
rootHandler = logService.configureAccessLogHandler(rootHandler);
}
GateHandlerWrapper gateHandlerWrapper = this.gateHandlerWrapper;
if (gateHandlerWrapper != null) {
rootHandler = gateHandlerWrapper.wrap(rootHandler);
}
return rootHandler;
}
Aggregations