|
| 1 | +@startuml |
| 2 | + |
| 3 | +actor user |
| 4 | + |
| 5 | +activate CatalinaProperties |
| 6 | +activate ClassLoaderFactory |
| 7 | +CatalinaProperties -> CatalinaProperties : loadProperties(); |
| 8 | + |
| 9 | +user -> Bootstrap : main() |
| 10 | +activate Bootstrap |
| 11 | + Bootstrap -> Bootstrap : init() |
| 12 | + activate Bootstrap |
| 13 | + Bootstrap -> Bootstrap : initClassLoaders() |
| 14 | + activate Bootstrap |
| 15 | + Bootstrap -> Bootstrap: createClassLoader() |
| 16 | + activate Bootstrap |
| 17 | + Bootstrap -> CatalinaProperties : getProperty("common.loader") |
| 18 | + Bootstrap <-- CatalinaProperties : common.loader |
| 19 | + Bootstrap -> ClassLoaderFactory : createClassLoader(); |
| 20 | + Bootstrap <-- ClassLoaderFactory : classLoader |
| 21 | + deactivate Bootstrap |
| 22 | + deactivate Bootstrap |
| 23 | + Bootstrap -> Catalina : startupClass.newInstance(); |
| 24 | + activate Catalina |
| 25 | + Bootstrap <-- Catalina : a instance of Catalina |
| 26 | + Bootstrap -> Catalina : setParentClassLoader(sharedLoader) |
| 27 | + deactivate Bootstrap |
| 28 | + Bootstrap -> Bootstrap : setAwait(true) |
| 29 | + activate Bootstrap |
| 30 | + Bootstrap -> Catalina : setAwait(true) |
| 31 | + deactivate Bootstrap |
| 32 | + Bootstrap -> Bootstrap : load(); |
| 33 | + activate Bootstrap |
| 34 | + Bootstrap -> Catalina : load(); |
| 35 | + Catalina -> Catalina : initDirs(); |
| 36 | + Catalina -> Catalina : initNaming(); |
| 37 | + Catalina -> Catalina : createStartDigester(); |
| 38 | + activate Catalina |
| 39 | + Catalina -> Catalina : config digester rule set for server.xml |
| 40 | + Catalina -> Digester : parse(); parse from config/server.xml |
| 41 | + activate Digester |
| 42 | + Digester -> StandardServer : newInstance(); |
| 43 | + activate StandardServer |
| 44 | + StandardServer -> StandardServer : set port and shutdown property |
| 45 | + StandardServer -> Catalina : setServer(); |
| 46 | + Digester -> Listener : newInstance(); |
| 47 | + activate Listener |
| 48 | + Listener -> Listener : set property |
| 49 | + Listener -> StandardServer : addLifeCycleListener() |
| 50 | + deactivate Listener |
| 51 | + Digester -> NamingResourcesImpl : newInstance() |
| 52 | + activate NamingResourcesImpl |
| 53 | + NamingResourcesImpl -> NamingResourcesImpl : setProperty |
| 54 | + NamingResourcesImpl -> StandardServer : setGlobalNamingResources(); |
| 55 | + deactivate NamingResourcesImpl |
| 56 | + Digester -> StandardService : new Instance |
| 57 | + activate StandardService |
| 58 | + StandardService -> StandardService : set name property; |
| 59 | + StandardService -> StandardServer : addService(); |
| 60 | + activate StandardServer |
| 61 | + StandardServer -> StandardService : setServer() |
| 62 | + deactivate StandardServer |
| 63 | + Digester -> Connector : newInstance() |
| 64 | + activate Connector |
| 65 | + Connector -> Http11NioProtocol : newInstance() |
| 66 | + activate Http11NioProtocol |
| 67 | + activate NioEndPoint |
| 68 | + activate NioSelectorPool |
| 69 | + NioEndPoint -> Http11NioProtocol : new NioEndPoint(); |
| 70 | + deactivate Http11NioProtocol |
| 71 | + Connector -> Connector : set port,protocol,etc property |
| 72 | + Connector -> StandardService : addConnector() |
| 73 | + Digester -> StandardEngine : newInstance(); |
| 74 | + activate StandardEngine |
| 75 | + StandardEngine -> Engine.StandardPipeline : new StandardPipeline(this); |
| 76 | + activate Engine.StandardPipeline |
| 77 | + Engine.StandardPipeline -> StandardEngine : setContainer() |
| 78 | + Engine.StandardPipeline -> StandardEngineValve : setBasic() |
| 79 | + activate StandardEngineValve |
| 80 | + deactivate StandardEngineValve |
| 81 | + deactivate Engine.StandardPipeline |
| 82 | + StandardEngine -> StandardEngine : addLifecycleListener(EngineConfig) |
| 83 | + StandardEngine -> StandardEngine : setproperty |
| 84 | + StandardEngine -> StandardService : setContainer() |
| 85 | + |
| 86 | + Digester -> LockOutRealm : newInstance() |
| 87 | + LockOutRealm -> StandardEngine : setRealm(); |
| 88 | + |
| 89 | + Digester -> StandardHost : newInstance(); |
| 90 | + activate StandardHost |
| 91 | + StandardHost -> Host.StandardPipeline : new StandardPipeline(this); |
| 92 | + activate Host.StandardPipeline |
| 93 | + Host.StandardPipeline -> StandardHost : setContainer(); |
| 94 | + Host.StandardPipeline -> StandardHostValve : setBasic(); |
| 95 | + activate StandardHostValve |
| 96 | + deactivate StandardHostValve |
| 97 | + deactivate Host.StandardPipeline |
| 98 | + StandardHost -> StandardEngine : getParentClassLoader(); |
| 99 | + StandardEngine -> StandardService : getParentClassLoader(); |
| 100 | + StandardService -> StandardServer : getParentClassLoader(); |
| 101 | + StandardServer -> Catalina : getParentClassLoader(); |
| 102 | + Catalina --> StandardHost : sharedClassLoader |
| 103 | + StandardHost -> StandardHost : setParentClassLoader() |
| 104 | + StandardHost -> StandardHost : addLifecycleListener(HostConfig); |
| 105 | + StandardHost -> StandardHost : setProperty |
| 106 | + StandardHost -> StandardEngine : addChild(); |
| 107 | + activate StandardEngine |
| 108 | + StandardEngine -> StandardHost : setParent(); |
| 109 | + deactivate StandardEngine |
| 110 | + Digester -> AccessLogValve : newInstance(); |
| 111 | + activate AccessLogValve |
| 112 | + AccessLogValve -> AccessLogValve : setProperty |
| 113 | + AccessLogValve -> StandardHost : addValve() |
| 114 | + deactivate AccessLogValve |
| 115 | + deactivate Digester |
| 116 | + Catalina -> StandardServer : setCatalina, setCatalinaBase, setCatalinaHome |
| 117 | + StandardServer -> StandardServer: initStream(); |
| 118 | + Catalina -> StandardServer : init(); |
| 119 | + activate StandardServer |
| 120 | + StandardServer -> StandardServer : initInternal() |
| 121 | + activate StandardServer |
| 122 | + StandardServer -> StandardService : init() |
| 123 | + activate StandardService |
| 124 | + StandardService -> StandardService : initInternal() |
| 125 | + activate StandardService |
| 126 | + StandardService -> StandardEngine : init() |
| 127 | + activate StandardEngine |
| 128 | + StandardEngine -> StandardEngine : reconfigureStartStopExecutor() |
| 129 | + deactivate StandardEngine |
| 130 | + StandardService -> Connector : init() |
| 131 | + activate Connector |
| 132 | + Connector -> Connector : new CoyoteAdapter(this); |
| 133 | + Connector -> Http11NioProtocol : init(); |
| 134 | + activate Http11NioProtocol |
| 135 | + Http11NioProtocol -> Http11NioProtocol : getName(); |
| 136 | + Http11NioProtocol -> NioEndPoint : setName() |
| 137 | + activate NioEndPoint |
| 138 | + NioEndPoint -> NioEndPoint : bind(); |
| 139 | + activate NioEndPoint |
| 140 | + NioEndPoint -> NioEndPoint : initServerSocket(); |
| 141 | + NioEndPoint -> NioSelectorPool : open(); |
| 142 | + deactivate NioEndPoint |
| 143 | + deactivate NioEndPoint |
| 144 | + deactivate Http11NioProtocol |
| 145 | + deactivate Connector |
| 146 | + deactivate StandardService |
| 147 | + deactivate StandardService |
| 148 | + deactivate StandardServer |
| 149 | + deactivate StandardServer |
| 150 | + deactivate Catalina |
| 151 | + deactivate Bootstrap |
| 152 | + Bootstrap -> Bootstrap : start(); |
| 153 | +deactivate Bootstrap |
| 154 | + |
| 155 | +footer |
| 156 | +图 2 Tomcat init |
| 157 | +endfooter |
| 158 | + |
| 159 | +@enduml |
0 commit comments