本文整理了Java中org.apache.catalina.Context.getName()
方法的一些代码示例,展示了Context.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getName()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:getName
暂无
代码示例来源:origin: redisson/redisson
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);
}
代码示例来源:origin: redisson/redisson
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);
}
代码示例来源:origin: redisson/redisson
public RTopic getTopic() {
String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":";
final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + getContext().getName();
return redisson.getTopic(name);
}
代码示例来源:origin: redisson/redisson
public RTopic getTopic() {
String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":";
final String name = keyPrefix + separator + "redisson:tomcat_session_updates:" + getContext().getName();
return redisson.getTopic(name);
}
代码示例来源:origin: apache/geode
protected String getContextName() {
return getTheContext().getName();
}
代码示例来源:origin: OryxProject/oryx
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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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());
}
}
代码示例来源:origin: psi-probe/psi-probe
/**
* 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;
}
代码示例来源:origin: psi-probe/psi-probe
/**
* 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;
}
代码示例来源:origin: psi-probe/psi-probe
@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;
}
代码示例来源:origin: psi-probe/psi-probe
@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));
}
代码示例来源:origin: magro/memcached-session-manager
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);
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
内容来源于网络,如有侵权,请联系作者删除!