StandardContext.start
2016-05-22 16:53
288 查看
public synchronized void start() throws LifecycleException { ……… if( !initialized ) { try { init(); } catch( Exception ex ) { throw new LifecycleException("Error initializaing ", ex); } } ……… lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null); setAvailable(false); setConfigured(false); boolean ok = true; File configBase = getConfigBase(); if (configBase != null) { if (getConfigFile() == null) { File file = new File(configBase, getDefaultConfigFile()); setConfigFile(file.getPath()); try { File appBaseFile = new File(getAppBase()); if (!appBaseFile.isAbsolute()) { appBaseFile = new File(engineBase(), getAppBase()); } String appBase = appBaseFile.getCanonicalPath(); String basePath = (new File(getBasePath())).getCanonicalPath(); if (!basePath.startsWith(appBase)) { Server server = ServerFactory.getServer(); ((StandardServer) server).storeContext(this); } } catch (Exception e) { log.warn("Error storing config file", e); } } else { try { String canConfigFile = (new File(getConfigFile())).getCanonicalPath(); if (!canConfigFile.startsWith (configBase.getCanonicalPath())) { File file = new File(configBase, getDefaultConfigFile()); if (copy(new File(canConfigFile), file)) { setConfigFile(file.getPath()); } } } catch (Exception e) { log.warn("Error setting config file", e); } } } ……… Container children[] = findChildren(); for (int i = 0; i < children.length; i++) { if (children[i] instanceof Lifecycle) ((Lifecycle) children[i]).start(); } if (pipeline instanceof Lifecycle) ((Lifecycle) pipeline).start(); ……… }
相关文章推荐
- Android Fragment 真正的完全解析(上)
- 约瑟夫环变种
- 大数据与市场营销
- 贪心算法之单源最短路径
- Git多账号配置
- SVN常用命令汇总
- 关于jQuery和AJAX的解析
- XSS 攻击实验 & 防御方案
- 关于hibernate5.1.0中Table 'spring.hibernate_sequence' doesn't exist的解决办法
- 获取datagrid勾选的ID
- hdoj 瞬间移动 5698(逆元)
- c++学习笔记(8)——关于模板类
- sql 入门经典(第五版) Ryan Stephens 学习笔记 (第一,二,三,,四,五章)
- Linux命令——压缩和解压缩
- mysql外键(FOREIGN KEY)的简单使用
- Android进程间通信(IPC)之Binder连接池
- 【Spring】【笔记】《Spring In Action》第二章 Bean装配
- UVa 272(输入输出)
- 关于OpenCV的那些事——相机标定
- 第12课 :Spark Streaming源码解读之Executor容错安全性