public synchronized boolean enableContext ( final String contextPath , final String jvmRoute , final List < String > aliases ) { final Node node = nodes . get ( jvmRoute ) ; if ( node != null ) { Context context = node . getContext ( contextPath , aliases ) ; if ( context == null ) { context = node . registerContext ( contextPath , aliases ) ; UndertowLogger . ROOT_LOGGER . registeringContext ( contextPath , jvmRoute ) ; UndertowLogger . ROOT_LOGGER . registeringContext ( contextPath , jvmRoute , aliases ) ; for ( final String alias : aliases ) { VirtualHost virtualHost = hosts . get ( alias ) ; if ( virtualHost == null ) { virtualHost = new VirtualHost ( ) ; hosts . put ( alias , virtualHost ) ; } virtualHost . registerContext ( contextPath , jvmRoute , context ) ; } } context . enable ( ) ; return true ; } return false ; }
Register a web context . If the web context already exists just enable it .