日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

tomcat server容器解讀

系統 2252 0

1. server的實例類為:org.apache.catalina.core.StandardServer為頂層容器。

2.二級容器GlobalNamingResources,設置認證用戶信息。

? <GlobalNamingResources>

??? <!-- Editable user database that can also be used by

???????? UserDatabaseRealm to authenticate users

??? -->

??? <Resource name="UserDatabase" auth="Container"

????????????? type="org.apache.catalina.UserDatabase"

????????????? description="User database that can be updated and saved"

????????????? factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

????????????? pathname="conf/tomcat-users.xml" />

? </GlobalNamingResources>

3. 二級容器service,包括了多個connector和一個engine

? <!-- A "Service" is a collection of one or more "Connectors" that share

?????? a single "Container" Note:? A "Service" is not itself a "Container",

?????? so you may not define subcomponents such as "Valves" at this level.

?????? Documentation at /docs/config/service.html

?? -->

? <Service name="Catalina">
??? <Connector port="8080" protocol="HTTP/1.1"
?????????????? connectionTimeout="20000"
?????????????? redirectPort="8443" />
??? <!-- Define an AJP 1.3 Connector on port 8009 -->
??? <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
??? <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
??? -->
??? <Engine name="Catalina" defaultHost="localhost">

3. 三級容器Engine包括Realm和Host。

??? <Engine name="Catalina" defaultHost="localhost">

?

????? <!--For clustering, please take a look at documentation at:

????????? /docs/cluster-howto.html? (simple how to)

????????? /docs/config/cluster.html (reference documentation) -->

????? <!--

????? <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

????? -->

?

?? ???<!-- Use the LockOutRealm to prevent attempts to guess user passwords

?????????? via a brute-force attack -->

????? <Realm className="org.apache.catalina.realm.LockOutRealm">

??????? <!-- This Realm uses the UserDatabase configured in the global JNDI

? ???????????resources under the key "UserDatabase".? Any edits

???????????? that are performed against this UserDatabase are immediately

???????????? available for use by the Realm.? -->

??????? <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

?????????????? resourceName="UserDatabase"/>

????? </Realm>

?

????? <Host name="localhost"? appBase="webapps"

??????????? unpackWARs="true" autoDeploy="true">

?

??????? <!-- SingleSignOn valve, share authentication between web applications

???????????? Documentation at: /docs/config/valve.html -->

??????? <!--

??????? <Valve className="org.apache.catalina.authenticator.SingleSignOn" />

??????? -->

?

??????? <!-- Access log processes all example.

???????????? Documentation at: /docs/config/valve.html

???????????? Note: The pattern used is equivalent to using pattern="common" -->

??????? <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

?????????????? prefix="localhost_access_log." suffix=".txt"

?????????????? pattern="%h %l %u %t &quot;%r&quot; %s %b" />

?

????? </Host>

??? </Engine>

實現類關系

Event-Listerner事件監聽模式

事件監聽同步模式分兩個部分:Event Source和Event Listener:
Event Source:被監聽者的事件集合,可能是方法,提供事件的注冊加入和移除功能。類似被觀察者的集合。
Event Listener:事件的監聽者,當事件被觸發,所有監聽這個事件的監聽者將被通知,然后執行自己的Action響應動作。

事件監聽異步模式在Source和Listener之間引入event queue,
event queue是一個基于事件的publish-subscribe. 它一種松耦合方式提供不同模塊和角色之間異步通訊。它比同步更加松耦合,這樣,我們就把Source-Listener改成了publish-queue-subscribe方式。

?

tomcat server容器解讀


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!??!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 乌鲁木齐市| 禄丰县| 衡山县| 西昌市| 浦县| 丹棱县| 元江| 特克斯县| 合肥市| 隆化县| 宁城县| 石林| 鲁甸县| 惠来县| 宁海县| 乌恰县| 潍坊市| 土默特右旗| 富民县| 汝南县| 兴城市| 大关县| 东阳市| 广安市| 江华| 凉城县| 寿光市| 苍山县| 油尖旺区| 舟山市| 汨罗市| 万州区| 深州市| 凤城市| 黎川县| 临沂市| 瓦房店市| 宁晋县| 吉隆县| 祁阳县| 泗阳县|