public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException
{
try
{
WebAppContext wctx = archive.as(ShrinkWrapWebAppContext.class);
if(configurationClasses != null)
{
wctx.setConfigurationClasses(configurationClasses);
}
// possible configuration parameters
wctx.setExtractWAR(true);
wctx.setLogUrlOnStart(true);
/*
* ARQ-242 Without this set we result in failure on loading Configuration in container.
* ServiceLoader finds service file from AppClassLoader, tried to load JettyContainerConfiguration from AppClassLoader
* as a ContainerConfiguration from WebAppClassContext. ClassCastException.
*/
wctx.setParentLoaderPriority(true);
((HandlerCollection) server.getHandler()).addHandler(wctx);
wctx.start();
webAppContextProducer.set(wctx);
HTTPContext httpContext = new HTTPContext(containerConfig.getBindAddress(), containerConfig.getBindHttpPort());
for(ServletHolder servlet : wctx.getServletHandler().getServlets())
{
httpContext.add(new Servlet(servlet.getName(), servlet.getContextPath()));
}
return new ProtocolMetaData()