/** * Return the context path for this Context. */ public String getPath() { return (getName()); }
/** * Return the context path for this Context. */ public String getPath() { return (getName()); }
/** * Return the context path for this Context. */ public String getPath() { return (getName()); }
public WebAppInfo get() { final ContextInfo contextInfo = getContextInfo(standardContext); System.out.println("contextInfo = " + contextInfo); System.out.println("standardContext = " + standardContext); for (WebAppInfo webApp : contextInfo.appInfo.webApps) { if (standardContext.getName().equals("/"+webApp.contextRoot)) { return webApp; } } return null; }
public synchronized Collection<String> availableApps() { final Collection<String> apps = new ArrayList<>(); for (final ContextInfo info : infos.values()) { if (info.appInfo != null) { apps.add(info.appInfo.path); } else if (info.standardContext != null) { apps.add("[not deployed] " + info.standardContext.getName()); } } return apps; }
@Override public void declareRoles(String... roleNames) { if (isContextInitializedCalled) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_CONTEXT_ALREADY_INIT_EXCEPTION), new Object[] {"declareRoles", getName()}); throw new IllegalStateException(msg); } for (String roleName : roleNames) { addSecurityRole(roleName); } }
private String getId(StandardContext standardContext) { String contextRoot = standardContext.getName(); if (!contextRoot.startsWith("/")) contextRoot = "/" + contextRoot; return standardContext.getHostname() + contextRoot; }
/** * Check for unusual but valid <code><url-pattern></code>s. * See Bugzilla 34805, 43079 & 43080 */ protected void checkUnusualURLPattern(String urlPattern) { if (CatalinaLogger.CORE_LOGGER.isInfoEnabled()) { if(urlPattern.endsWith("*") && (urlPattern.length() < 2 || urlPattern.charAt(urlPattern.length()-2) != '/')) { CatalinaLogger.CORE_LOGGER.suspiciousUrlPattern(getName(), urlPattern); } } }
public void setAsyncSupported(boolean isAsyncSupported) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"load-on-startup", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setIsAsyncSupported(isAsyncSupported); }
public void setRunAsRole(String roleName) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"run-as", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setRunAs(roleName); }
public void setAsyncSupported(boolean isAsyncSupported) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"async-supported", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } filterDef.setIsAsyncSupported(isAsyncSupported); } }
public void setLoadOnStartup(int loadOnStartup) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"load-on-startup", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setLoadOnStartup(loadOnStartup); }
public boolean setInitParameter(String name, String value) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.FILTER_REGISTRATION_ALREADY_INIT), new Object[] {"init parameter", filterDef.getFilterName(), ctx.getName()}); throw new IllegalStateException(msg); } return filterDef.setInitParameter(name, value, false); }
public boolean setInitParameter(String name, String value) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"init parameter", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } return wrapper.setInitParameter(name, value, false); }
public AppInfo app() { final ContextInfo contextInfo = getContextInfo(standardContext); if (contextInfo == null) { logger.debug("No ContextInfo for StandardContext " + standardContext.getName()); return null; } return contextInfo.appInfo; }
public void preDeregister() throws Exception { if( started ) { try { stop(); } catch( Exception ex ) { CatalinaLogger.CORE_LOGGER.errorStoppingContext(getName(), ex); } } }
private static void undeploy(StandardContext standardContext, ContextInfo contextInfo) { if (isReady(contextInfo.deployer)) { contextInfo.deployer.unmanageApp(standardContext.getName()); } else if (contextInfo.host != null) { contextInfo.host.removeChild(standardContext); } }
protected void preRegisterJMX() { try { StandardHost host = (StandardHost) getParent(); if ((oname == null) || (oname.getKeyProperty("j2eeType") == null)) { oname = createObjectName(host.getDomain(), host.getJmxName()); controller = oname; } } catch(Exception ex) { CatalinaLogger.CORE_LOGGER.contextObjectNameCreationFailed(getName(), ex); } }
public void setMultipartConfig(MultipartConfigElement mpConfig) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.DYNAMIC_SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"multipart-config", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } wrapper.setMultipartLocation(mpConfig.getLocation()); wrapper.setMultipartMaxFileSize(mpConfig.getMaxFileSize()); wrapper.setMultipartMaxRequestSize(mpConfig.getMaxRequestSize()); wrapper.setMultipartFileSizeThreshold( mpConfig.getFileSizeThreshold()); }
public void initJ2EEInfo(final StandardContext standardContext) { if (initJEEInfo) { standardContext.setJ2EEServer(DEFAULT_J2EE_SERVER); final ContextInfo contextInfo = getContextInfo(standardContext); if (contextInfo == null || contextInfo.appInfo == null || contextInfo.appInfo.path == null) { standardContext.setJ2EEApplication(jmxName(standardContext.getName())); } else { standardContext.setJ2EEApplication(jmxName(shortName(contextInfo.appInfo.path))); } } }