private Context createDefaultContext(String contextPath, String docBase) { StandardContext context = new StandardContext(); context.setDocBase(docBase); context.setPath(contextPath); ContextConfig config = new ContextConfig(); context.addLifecycleListener(config); return context; }
private Context createDefaultContext(String contextPath, String docBase) { StandardContext context = new StandardContext(); context.setDocBase(docBase); context.setPath(contextPath); ContextConfig config = new ContextConfig(); context.addLifecycleListener(config); return context; }
private StandardContext createContext(String path, String docBase) { StandardContext context = new StandardContext(); context.setUnpackWAR(false); context.setDocBase(docBase); context.setPath(path); ContextConfig config = new ContextConfig(); context.addLifecycleListener(config); return (context); } }
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
public void deployWebApps(AppInfo appInfo, ClassLoader classLoader) throws Exception { for (WebAppInfo webApp : appInfo.webApps) { if (getContextInfo(webApp) == null) { StandardContext standardContext = new StandardContext(); String contextXmlFile = webApp.codebase + "/META-INF/context.xml"; if (new File(contextXmlFile).exists()) { standardContext.setConfigFile(contextXmlFile); standardContext.setOverride(true); } ContextConfig contextConfig = new ContextConfig(); standardContext.addLifecycleListener(contextConfig); standardContext.setPath("/" + webApp.contextRoot); standardContext.setDocBase(webApp.codebase); standardContext.setParentClassLoader(classLoader); standardContext.setDelegate(true); String host = webApp.host; if (host == null) host = "localhost"; HostConfig deployer = deployers.get(host); if (deployer != null) { // host isn't set until we call deployer.manageApp, so pass it ContextInfo contextInfo = addContextInfo(host, standardContext); contextInfo.appInfo = appInfo; contextInfo.deployer = deployer; contextInfo.standardContext = standardContext; deployer.manageApp(standardContext); } } } }
private StandardContext createContext(String path, String docBase, ClassLoader classLoader, Map<String, List<Injector<?>>> injectors) { StandardContext context = new StandardContext(); context.setDocBase(docBase); context.setPath(path); ContextConfig config = new ContextConfig(); context.addLifecycleListener(config); context.setParentClassLoader(classLoader); Fabric3Loader loader = new Fabric3Loader(classLoader); context.setLoader(loader); // turn off unpacking so Tomcat does not copy the extracted WAR to the /webapps directory and autodeploy it on a subsequent boot context.setUnpackWAR(false); Fabric3AnnotationProcessor annotationProcessor = new Fabric3AnnotationProcessor(injectors); context.setAnnotationProcessor(annotationProcessor); context.getServletContext().setAttribute(AnnotationProcessor.class.getName(), annotationProcessor); return (context); }
docBase.mkdirs(); context.setDocBase(docBase.getPath());
@Override public Context createContext(String path, String docBase) { if( log.isDebugEnabled() ) log.debug("Creating context '" + path + "' with docBase '" + docBase + "'"); context = new StandardContext(); context.setDocBase(docBase); context.setPath(path); ContextConfig config = new ContextConfig(); config.setCustomAuthenticators(authenticators); ((Lifecycle) context).addLifecycleListener(config); return (context); }
_serverContext.setDocBase(docBase.getPath()); _serverContext.addLifecycleListener(new ContextConfig());
serverContext.setDocBase(docBase.getPath()); serverContext.addLifecycleListener(new ContextConfig());
_serverContext.setDocBase(docBase.getPath()); _serverContext.addLifecycleListener(new ContextConfig());
serverContext.setDocBase(docBase.getPath()); serverContext.addLifecycleListener(new ContextConfig());
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
context.setDocBase(docBase); context.setPath(path);
private static StandardContext startWebApp(Host host, WSEndpointDeploymentUnit unit) throws Exception { StandardContext context = new StandardContext(); try { JBossWebMetaData jbwebMD = unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY); context.setPath(jbwebMD.getContextRoot()); context.addLifecycleListener(new ContextConfig()); ServerConfigService config = (ServerConfigService)unit.getServiceRegistry().getService(WSServices.CONFIG_SERVICE).getService(); File docBase = new File(config.getValue().getServerTempDir(), jbwebMD.getContextRoot()); if (!docBase.exists()) { docBase.mkdirs(); } context.setDocBase(docBase.getPath()); final Loader loader = new WebCtxLoader(unit.getAttachment(WSAttachmentKeys.CLASSLOADER_KEY)); loader.setContainer(host); context.setLoader(loader); context.setInstanceManager(new LocalInstanceManager()); addServlets(jbwebMD, context); host.addChild(context); context.create(); } catch (Exception e) { throw MESSAGES.createContextPhaseFailed(e); } try { context.start(); } catch (LifecycleException e) { throw MESSAGES.startContextPhaseFailed(e); } return context; }