⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soa-overview.xtp

📁 RESIN 3.2 最新源码
💻 XTP
字号:
<document>  <header>    <product>resin</product>    <resin-2.0>$resin/ref/jndi.xtp</resin-2.0>    <title>Resource Configuration</title>  </header>  <body>    <localtoc/><s1 title="web-apps and JNDI Contexts"><p>Resin organizes its resources into a tree, rooted in thesystem classloader.  Each Resin context is associated with a classloader,a JNDI context, and a set of resources (databases, JMS, EJB beans, etc.)</p><p>Child contexts inherit classes and resources fromthe parent contexts.  For example, a database with a JNDI name"java:comp/env/jdbc/foo" belonging to the foo.com virtual host would beshared for all web-applications in that host.</p><p>When Resin detects class or configuration changes in a context, itwill reload that context and all child contexts.  This is how Resinreloads an application when a servlet changes.</p><figure src="jndi_tree.gif"/><p>Each web-app gets its own JNDI copy.  So a web-app named /quercusand a web-app named /cmp could each use java:comp/env/jdbc/test for adatabase pool, but would use unique pools (probably usingdifferent databases.)</p><p>This separation keeps web-apps from stepping on each other's toesand also lets each virtual host use different databases.</p><p>The web-apps can share JNDI configuration from its host, and thehosts can share JNDI configuration from the global server.  Eachweb-app copies the host JNDI tree, and each host copies the serverJNDI tree.  So the web-app can't affect the host's JNDI, but it canshare the host's pools.</p><p>In Resin's configuration, the context determines where the JNDIwill be shared.  If the JNDI configuration is in the &lt;host&gt;, it willbe shared across the entire host.  If it's in the &lt;web-app&gt;, itwill only be used in the web-app.</p><deftable><tr><th>context</th><th>scope</th></tr><tr><td>http-server</td><td>shared across all applications</td></tr><tr><td>host</td><td>shared across the virtual host</td></tr><tr><td>web-app</td><td>specific to the servlet application (.war)</td></tr></deftable><example title="host and web-app specific configuration">...&lt;host id='foo.com'&gt;  &lt;database name='jdbc/foo'&gt;    &lt;driver-class id="org.gjt.mm.mysql.Driver"/&gt;    &lt;driver-url id="jdbc:mysql://localhost:3306/foo"/&gt;  &lt;/database&gt;  &lt;web-app id='/quercus'&gt;    &lt;database name='jdbc/quercus'.      &lt;driver-class id="org.gjt.mm.mysql.Driver"/&gt;      &lt;driver-url id="jdbc:mysql://localhost:3306/quercus"/&gt;    &lt;/database&gt;  &lt;/web-app&gt;&lt;/host&gt;...</example><p>In the previous example, the java:comp/env/jdbc/foo pool is sharedacross all web-apps in foo.com, but the java:comp/env/jdbc/quercuspool is only available in the /quercus web-app.</p></s1>  </body></document>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -