Top Description Fields Constructors Methods
io.undertow.server.handlers

public Class NameVirtualHostHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
java.util.Locale, .Map, io.undertow.Handlers, io.undertow.server.HttpHandler, .HttpServerExchange, io.undertow.util.CopyOnWriteMap, .Headers

A HttpHandler that implements virtual hosts based on the Host: http header header.
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private volatile HttpHandler
private final Map<String, HttpHandler>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized NameVirtualHostHandler
addHost(final String host, final HttpHandler handler)

public HttpHandler
public Map<String, HttpHandler>
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

public synchronized NameVirtualHostHandler
removeHost(final String host)

public NameVirtualHostHandler
setDefaultHandler(final HttpHandler defaultHandler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultHandlerback to summary
private volatile HttpHandler defaultHandler
hostsback to summary
private final Map<String, HttpHandler> hosts

Constructor Detail

NameVirtualHostHandlerback to summary
public NameVirtualHostHandler()

Method Detail

addHostback to summary
public synchronized NameVirtualHostHandler addHost(final String host, final HttpHandler handler)
getDefaultHandlerback to summary
public HttpHandler getDefaultHandler()
getHostsback to summary
public Map<String, HttpHandler> getHosts()
handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
removeHostback to summary
public synchronized NameVirtualHostHandler removeHost(final String host)
setDefaultHandlerback to summary
public NameVirtualHostHandler setDefaultHandler(final HttpHandler defaultHandler)