public RTopic getTopic() { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + ((Context) getContainer()).getName(); return redisson.getTopic(name); }
public RTopic getTopic() { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + ((Context) getContainer()).getName(); return redisson.getTopic(name); }
public RTopic getTopic() { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + getContext().getName(); return redisson.getTopic(name); }
public RTopic getTopic() { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + getContext().getName(); return redisson.getTopic(name); }
protected String getContextName() { return getTheContext().getName(); }
private static void doTestServingLayer(Config config) throws IOException { try (ServingLayer servingLayer = new ServingLayer(config)) { servingLayer.start(); Context context = servingLayer.getContext(); assertNotNull(context.findErrorPage(500)); assertEquals(0, context.getApplicationLifecycleListeners().length); assertNotNull(context.findParameter(ConfigUtils.class.getName() + ".serialized")); assertNotNull(context.getName()); assertGreaterOrEqual(Double.parseDouble(context.getWebappVersion()), 3.1); } }
@Override public void discardWorkDir(Context context) { if (context instanceof StandardContext) { StandardContext standardContext = (StandardContext) context; String path = standardContext.getWorkPath(); logger.info("Discarding '{}'", path); Utils.delete(new File(path, "org")); } else { logger.error("context '{}' is not an instance of '{}', expected StandardContext", context.getName(), context.getClass().getName()); } }
/** * Gets the application servlets. * * @param context the context * @return the application servlets */ public static List<ServletInfo> getApplicationServlets(Context context) { Container[] cns = context.findChildren(); List<ServletInfo> servlets = new ArrayList<>(cns.length); for (Container container : cns) { if (container instanceof Wrapper) { Wrapper wrapper = (Wrapper) container; servlets.add(getServletInfo(wrapper, context.getName())); } } return servlets; }
/** * Gets the application servlet. * * @param context the context * @param servletName the servlet name * @return the application servlet */ public static ServletInfo getApplicationServlet(Context context, String servletName) { Container container = context.findChild(servletName); if (container instanceof Wrapper) { Wrapper wrapper = (Wrapper) container; return getServletInfo(wrapper, context.getName()); } return null; }
@Override public String getServletFileNameForJsp(Context context, String jspName) { String servletName = null; ServletConfig servletConfig = (ServletConfig) context.findChild("jsp"); if (servletConfig != null) { ServletContext sctx = context.getServletContext(); Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt); JspCompilationContext jcctx = createJspCompilationContext(jspName, opt, sctx, jrctx, null); servletName = jcctx.getServletJavaFileName(); } else { logger.error(NO_JSP_SERVLET, context.getName()); } return servletName; }
@Override protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { /* * Create a list of webapp classloaders. This will help us to associate threads with * applications. */ List<Context> contexts = getContainerWrapper().getTomcatContainer().findContexts(); Map<String, String> classLoaderMap = new TreeMap<>(); for (Context context : contexts) { if (context.getLoader() != null && context.getLoader().getClassLoader() != null) { classLoaderMap.put(toUid(context.getLoader().getClassLoader()), context.getName()); } } return new ModelAndView(getViewName(), "threads", enumerateThreads(classLoaderMap)); }
protected MemcachedNodesManager createMemcachedNodesManager(final String memcachedNodes, final String failoverNodes) { final Context context = _manager.getContext(); final String webappVersion = Reflections.invoke(context, "getWebappVersion", null); final StorageKeyFormat storageKeyFormat = StorageKeyFormat.of(_storageKeyPrefix, context.getParent().getName(), context.getName(), webappVersion); return MemcachedNodesManager.createFor( memcachedNodes, failoverNodes, storageKeyFormat, _storageClientCallback); }
@Override public void addContextResourceLink(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResources namingResources = context.getNamingResources(); for (ContextResourceLink link : namingResources.findResourceLinks()) { ApplicationResource resource = new ApplicationResource(); logger.debug("reading resourceLink: {}", link.getName()); resource.setApplicationName(context.getName()); resource.setName(link.getName()); resource.setType(link.getType()); resource.setLinkTo(link.getGlobal()); resourceList.add(resource); } }
@Override public void addContextResourceLink(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResourceLink link : namingResources.findResourceLinks()) { ApplicationResource resource = new ApplicationResource(); logger.debug("reading resourceLink: {}", link.getName()); resource.setApplicationName(context.getName()); resource.setName(link.getName()); resource.setType(link.getType()); resource.setLinkTo(link.getGlobal()); registerGlobalResourceAccess(link); resourceList.add(resource); } }
@Override public void addContextResourceLink(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResourceLink link : namingResources.findResourceLinks()) { ApplicationResource resource = new ApplicationResource(); logger.debug("reading resourceLink: {}", link.getName()); resource.setApplicationName(context.getName()); resource.setName(link.getName()); resource.setType(link.getType()); resource.setLinkTo(link.getGlobal()); registerGlobalResourceAccess(link); resourceList.add(resource); } }
@Override public void addContextResourceLink(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResourceLink link : namingResources.findResourceLinks()) { ApplicationResource resource = new ApplicationResource(); logger.debug("reading resourceLink: {}", link.getName()); resource.setApplicationName(context.getName()); resource.setName(link.getName()); resource.setType(link.getType()); resource.setLinkTo(link.getGlobal()); registerGlobalResourceAccess(link); resourceList.add(resource); } }
@Override public void addContextResource(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResource contextResource : namingResources.findResources()) { ApplicationResource resource = new ApplicationResource(); logger.info("reading resource: {}", contextResource.getName()); resource.setApplicationName(context.getName()); resource.setName(contextResource.getName()); resource.setType(contextResource.getType()); resource.setScope(contextResource.getScope()); resource.setAuth(contextResource.getAuth()); resource.setDescription(contextResource.getDescription()); resourceList.add(resource); } }
@Override public void addContextResource(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResource contextResource : namingResources.findResources()) { ApplicationResource resource = new ApplicationResource(); logger.info("reading resource: {}", contextResource.getName()); resource.setApplicationName(context.getName()); resource.setName(contextResource.getName()); resource.setType(contextResource.getType()); resource.setScope(contextResource.getScope()); resource.setAuth(contextResource.getAuth()); resource.setDescription(contextResource.getDescription()); resourceList.add(resource); } }
@Override public void addContextResource(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResourcesImpl namingResources = context.getNamingResources(); for (ContextResource contextResource : namingResources.findResources()) { ApplicationResource resource = new ApplicationResource(); logger.info("reading resource: {}", contextResource.getName()); resource.setApplicationName(context.getName()); resource.setName(contextResource.getName()); resource.setType(contextResource.getType()); resource.setScope(contextResource.getScope()); resource.setAuth(contextResource.getAuth()); resource.setDescription(contextResource.getDescription()); resourceList.add(resource); } }
@Override public void addContextResource(Context context, List<ApplicationResource> resourceList, boolean contextBound) { NamingResources namingResources = context.getNamingResources(); for (ContextResource contextResource : namingResources.findResources()) { ApplicationResource resource = new ApplicationResource(); logger.info("reading resource: {}", contextResource.getName()); resource.setApplicationName(context.getName()); resource.setName(contextResource.getName()); resource.setType(contextResource.getType()); resource.setScope(contextResource.getScope()); resource.setAuth(contextResource.getAuth()); resource.setDescription(contextResource.getDescription()); resourceList.add(resource); } }