Tomcat8.x 上下文(StandardServer)中命名上下文(NamingContext)的创建
来源:互联网 发布:数据库管理第三版答案 编辑:程序博客网 时间:2024/05/21 00:46
(StandardServer)中命名上下文(NamingContext)的创建
// 命名上下文的创建---------1class org.apache.catalina.core.StandardServer{// 构造函数public StandardServer() {// “命名资源”globalNamingResources = new NamingResourcesImpl();globalNamingResources.setContainer(this);// 创建“命名上下文”监听器 namingContextListener = new NamingContextListener(); addLifecycleListener(namingContextListener);}protected void startInternal() throws LifecycleException {// 触发监听器// org.apache.catalina.core.NamingContextListener.lifecycleEvent(...)fireLifecycleEvent(CONFIGURE_START_EVENT, null); // "configure_start" 事件// org.apache.catalina.deploy.NamingResourcesImplglobalNamingResources.start();}}// "命名资源"class org.apache.catalina.deploy.NamingResourcesImpl{ protected void startInternal() throws LifecycleException { fireLifecycleEvent(CONFIGURE_START_EVENT, null); setState(LifecycleState.STARTING); }}// "命名上下文"监听器class org.apache.catalina.core.NamingContextListener{ // 事件处理器,创建"命名上下文" public void lifecycleEvent(LifecycleEvent event) { container = event.getLifecycle(); namingResources = ((Server) container).getGlobalNamingResources(); if (Lifecycle.CONFIGURE_START_EVENT.equals(event.getType())) { Hashtable<String, Object> contextEnv = new Hashtable<>(); namingContext = new NamingContext(contextEnv, getName()); // 创建"命名上下文"文---------- ContextAccessController.setSecurityToken(getName(), token); ContextAccessController.setSecurityToken(container, token); ContextBindings.bindContext(container, namingContext, token); createNamingContext(); // 创建“名称上下文” } } // 创建"命名上下文" private void createNamingContext() throws NamingException { // container === org.apache.catalina.core.StandardServer if (container instanceof Server) { // 走这里 compCtx = namingContext; // org.apache.naming.NamingContext envCtx = namingContext; } else { compCtx = namingContext.createSubcontext("comp"); envCtx = compCtx.createSubcontext("env"); } // Resources ContextResource[] resources = namingResources.findResources(); for (i = 0; i < resources.length; i++) { addResource(resources[i]); } }}
0 0
- Tomcat8.x 上下文(StandardServer)中命名上下文(NamingContext)的创建
- Tomcat8.x 上下文(StandardContext)中(名称上下文(NamingContext)的创建->名称上下文(NamingContext))的使用
- 上下文菜单的创建
- 上下文菜单的创建
- Tomcat8.x 在上下文的web.xml配置跳转到jsp文件<jsp-file>
- 多线程中两个必要的开销:线程的创建、上下文切换 上下文切换
- android-上下文菜单的创建
- Linux内核中进程上下文、中断上下文、原子上下文、用户上下文的理解
- 上下文
- 上下文
- windbg中所谓的上下文
- Linux内核中进程上下文和中断上下文的理解
- Linux内核中进程上下文和中断上下文的理解
- Linux内核中进程上下文和中断上下文的理解
- Tomcat8.x 启动start()->上下文发布->上下文中web.xml文件解析
- Tomcat8.x_ 上下文中的web.xml
- android-上下文菜单的创建 - 随心
- Android 创建其他应用的上下文对象
- [LeetCode]--221. Maximal Square
- 前端web资源word格式汇总
- Android的DrawText详解
- mac下的error: 'Access denied for user 'root'@'localhost' (using password: YES)'
- 斐波拉契数列-演变
- Tomcat8.x 上下文(StandardServer)中命名上下文(NamingContext)的创建
- AndroidEditText校验 只输入数字或特定字符
- ASimpleCache的使用,不用下载jar包
- 三角形面积求法 <包含三维坐标求三角形面积 3D>
- 我的servlet学习过程(二):tomcat服务器部分
- 指针常量和常量指针的区别
- 使用ptrace向已运行进程中注入.so并执行相关函数
- 高斯消元1(解方程)
- 112. Path Sum | LeetCode