remm 01/11/29 22:23:13
Modified: webapps/tomcat-docs/config ajp.xml context.xml
defaultcontext.xml project.xml server.xml
Added: webapps/tomcat-docs/config globalresources.xml
Log:
- Add some documentation on the possibility to define server-global JNDI
resources, in addition to the per-webapp JNDI resources.
Revision Changes Path
1.2 +6 -6 jakarta-tomcat-4.0/webapps/tomcat-docs/config/ajp.xml
Index: ajp.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/ajp.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ajp.xml 2001/11/30 02:52:08 1.1
+++ ajp.xml 2001/11/30 06:23:13 1.2
@@ -239,7 +239,7 @@
<subsection name="Sample worker.properties file">
<p>
-<pre>
+<source>
# ************ Begin worker.properties **************
worker.ajp13.type=ajp13
@@ -314,7 +314,7 @@
worker.ajp13.host=localhost
# ************ End worker.properties **************
-</pre>
+</source>
</p>
</subsection>
@@ -322,7 +322,7 @@
<subsection name="Sample uriworkermap.properties">
<p>
-<pre>
+<source>
# *********** Begin uriworkermap.properties ***
#
# Simple worker configuration file
@@ -337,7 +337,7 @@
# Advanced mount of the examples context
# /examples/servlet/*=ajp13
# ************* End uriworkermap.properties ****
-</pre>
+</source>
</p>
</subsection>
@@ -345,7 +345,7 @@
<subsection name="iis_redirect.reg">
<p>
-<pre>
+<source>
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi
Redirector\1.0]
"extension_uri"="/jakarta/isapi_redirect.dll"
@@ -353,7 +353,7 @@
"log_level"="emerg"
"worker_file"="C:\\jakarta-tomcat-4.0.1\\conf\\worker.properties"
"worker_mount_file"="C:\\jakarta-tomcat-4.0.1\\conf\\uriworkermap.properties"
-</pre>
+</source>
</p>
</subsection>
1.7 +41 -1 jakarta-tomcat-4.0/webapps/tomcat-docs/config/context.xml
Index: context.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/context.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- context.xml 2001/10/25 00:38:49 1.6
+++ context.xml 2001/11/30 06:23:13 1.7
@@ -523,7 +523,7 @@
<p>but does <em>not</em> require modification of the deployment
descriptor to customize this value.</p>
- <p>The valid attriutes for a <code><Resource></code> element
+ <p>The valid attributes for a <code><Resource></code> element
are as follows:</p>
<attributes>
@@ -641,6 +641,46 @@
</subsection>
+ <subsection name="Resource Links">
+
+ <p>This element is used to create a link to a global JNDI resource. Doing
+ a JNDI lookup on the link name will then return the linked global
+ resource.</p>
+
+ <p>For example, you can create a resource link like this:</p>
+<source>
+<Context ...>
+ ...
+ <ResourceLink name="linkToGlobalResource"
+ global="simpleValue"
+ type="java.lang.Integer"
+ ...
+</Context>
+</source>
+
+ <p>The valid attributes for a <code><ResourceLink></code> element
+ are as follows:</p>
+
+ <attributes>
+
+ <attribute name="global" required="true">
+ <p>The name of the linked global resource in the
+ gobal JNDI context.</p>
+ </attribute>
+
+ <attribute name="name" required="true">
+ <p>The name of the resource link to be created, relative to the
+ <code>java:comp/env</code> context.</p>
+ </attribute>
+
+ <attribute name="type" required="true">
+ <p>The fully qualified Java class name expected by the web
+ application when it performs a lookup for this resource link.</p>
+ </attribute>
+
+ </attributes>
+
+ </subsection>
</section>
1.3 +41 -0 jakarta-tomcat-4.0/webapps/tomcat-docs/config/defaultcontext.xml
Index: defaultcontext.xml
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/defaultcontext.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- defaultcontext.xml 2001/09/09 00:48:11 1.2
+++ defaultcontext.xml 2001/11/30 06:23:13 1.3
@@ -455,6 +455,47 @@
</subsection>
+ <subsection name="Resource Links">
+
+ <p>This element is used to create a link to a global JNDI resource. Doing
+ a JNDI lookup on the link name will then return the linked global
+ resource.</p>
+
+ <p>For example, you can create a resource link like this:</p>
+<source>
+<DefaultContext ...>
+ ...
+ <ResourceLink name="linkToGlobalResource"
+ global="simpleValue"
+ type="java.lang.Integer"
+ ...
+</DefaultContext>
+</source>
+
+ <p>The valid attributes for a <code><ResourceLink></code> element
+ are as follows:</p>
+
+ <attributes>
+
+ <attribute name="global" required="true">
+ <p>The name of the linked global resource in the
+ gobal JNDI context.</p>
+ </attribute>
+
+ <attribute name="name" required="true">
+ <p>The name of the resource link to be created, relative to the
+ <code>java:comp/env</code> context.</p>
+ </attribute>
+
+ <attribute name="type" required="true">
+ <p>The fully qualified Java class name expected by the web
+ application when it performs a lookup for this resource link.</p>
+ </attribute>
+
+ </attributes>
+
+ </subsection>
+
</section>
1.6 +1 -0 jakarta-tomcat-4.0/webapps/tomcat-docs/config/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/project.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- project.xml 2001/11/30 02:52:08 1.5
+++ project.xml 2001/11/30 06:23:13 1.6
@@ -35,6 +35,7 @@
<menu name="Nested Components">
<item name="Default Context" href="defaultcontext.html"/>
+ <item name="Global Resources" href="globalresources.html"/>
<item name="Loader" href="loader.html"/>
<item name="Logger" href="logger.html"/>
<item name="Manager" href="manager.html"/>
1.4 +8 -2 jakarta-tomcat-4.0/webapps/tomcat-docs/config/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/server.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- server.xml 2001/09/26 02:29:21 1.3
+++ server.xml 2001/11/30 06:23:13 1.4
@@ -67,8 +67,14 @@
<section name="Nested Components">
- <p>The only components that may be nested inside a <strong>Server</strong>
- element are one or more <a href="service.html">Service</a> elements.</p>
+ <p>The following components may be nested inside a <strong>Server</strong>
+ element:</p>
+ <ul>
+ <li><a href="service.html"><strong>Service</strong></a> -
+ One or more service element.</li>
+ <li><a href="globalresources.html"><strong>GlobalNamingResources</strong></a> -
+ Configure the JNDI global resources for the server.</li>
+ </ul>
</section>
1.1
jakarta-tomcat-4.0/webapps/tomcat-docs/config/globalresources.xml
Index: globalresources.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE document [
<!ENTITY project SYSTEM "project.xml">
]>
<document>
&project;
<properties>
<author email="[EMAIL PROTECTED]">Remy Maucherat</author>
<title>The GlobalNamingResources Component</title>
</properties>
<body>
<section name="Introduction">
<p>The <strong>GlobalNamingResources</strong> element represents the global
JNDI resources which are defined
for the <a href="server.html">Server</a>.</p>
</section>
<section name="Attributes">
</section>
<section name="Nested Components">
</section>
<section name="Special Features">
<subsection name="Environment Entries">
<p>You can configure named values that will be made visible to
web applications as environment entry resources, by nesting
<code><Environment></code> entries inside this element. For
example, you can create an environment entry like this:</p>
<source>
<GlobalNamingResources ...>
...
<Environment name="maxExemptions" value="10"
type="java.lang.Integer" override="false"/>
...
</GlobalNamingResources>
</source>
<p>This is equivalent to the inclusion of the following element in the
web application deployment descriptor (<code>/WEB-INF/web.xml</code>):
</p>
<source>
<env-entry>
<env-entry-name>maxExemptions</param-name>
<env-entry-value>10</env-entry-value>
<env-entry-type>java.lang.Integer</env-entry-type>
</env-entry>
</source>
<p>but does <em>not</em> require modification of the deployment descriptor
to customize this value.</p>
<p>The valid attributes for an <code><Environment></code> element
are as follows:</p>
<attributes>
<attribute name="description" required="false">
<p>Optional, human-readable description of this environment entry.</p>
</attribute>
<attribute name="name" required="true">
<p>The name of the environment entry to be created, relative to the
<code>java:comp/env</code> context.</p>
</attribute>
<attribute name="override" required="false">
<p>Set this to <code>false</code> if you do <strong>not</strong> want
an <code><env-entry></code> for the same environment entry name,
found in the web application deployment descriptor, to override the
value specified here. By default, overrides are allowed.</p>
</attribute>
<attribute name="type" required="true">
<p>The fully qualified Java class name expected by the web application
for this environment entry. Must be one of the legal values for
<code><env-entry-type></code> in the web application deployment
descriptor: <code>java.lang.Boolean</code>,
<code>java.lang.Byte</code>, <code>java.lang.Character</code>,
<code>java.lang.Double</code>, <code>java.lang.Float</code>,
<code>java.lang.Integer</code>, <code>java.lang.Long</code>,
<code>java.lang.Short</code>, or <code>java.lang.String</code>.</p>
</attribute>
<attribute name="value" required="true">
<p>The parameter value that will be presented to the application
when requested from the JNDI context. This value must be convertable
to the Java type defined by the <code>type</code> attribute.</p>
</attribute>
</attributes>
</subsection>
<subsection name="Resource Definitions">
<p>You can declare the characteristics of the resource
to be returned for JNDI lookups of <code><resource-ref></code> and
<code><resource-env-ref></code> elements in the web application
deployment descriptor. You <strong>MUST</strong> also define
<a href="#Resource Parameters">Resource Parameters</a>
for the same resource name, to configure
the object factory to be used (if not known to Tomcat already), and
the properties used to configure that object factory.</p>
<p>For example, you can create a resource definition like this:</p>
<source>
<GlobalNamingResources ...>
...
<Resource name="jdbc/EmployeeDB" auth="Container"
type="javax.sql.DataSource"
description="Employees Database for HR Applications"/>
...
</GlobalNamingResources>
</source>
<p>This is equivalent to the inclusion of the following element in the
web application deployment descriptor (<code>/WEB-INF/web.xml</code>):</p>
<source>
<resource-ref>
<description>Employees Database for HR Applications</description>
<res-ref-name>jdbc/EmployeeDB</res-ref-name>
<res-ref-type>javax.sql.DataSource</res-ref-type>
<res-auth>Container</res-auth>
</resource-ref>
</source>
<p>but does <em>not</em> require modification of the deployment
descriptor to customize this value.</p>
<p>The valid attriutes for a <code><Resource></code> element
are as follows:</p>
<attributes>
<attribute name="auth" required="false">
<p>Specify whether the web Application code signs on to the
corresponding resource manager programatically, or whether the
Container will sign on to the resource manager on behalf of the
application. The value of this attribute must be
<code>Application</code> or <code>Container</code>. This
attribute is <strong>required</strong> if the web application
will use a <code><resource-ref></code> element in the web
application deployment descriptor, but is optional if the
application uses a <code><resource-env-ref></code> instead.</p>
</attribute>
<attribute name="description" required="false">
<p>Optional, human-readable description of this resource.</p>
</attribute>
<attribute name="name" required="true">
<p>The name of the resource to be created, relative to the
<code>java:comp/env</code> context.</p>
</attribute>
<attribute name="scope" required="false">
<p>Specify whether connections obtained through this resource
manager can be shared. The value of this attribute must be
<code>Shareable</code> or <code>Unshareable</code>. By default,
connections are assumed to be shareable.</p>
</attribute>
<attribute name="type" required="true">
<p>The fully qualified Java class name expected by the web
application when it performs a lookup for this resource.</p>
</attribute>
</attributes>
</subsection>
<subsection name="Resource Parameters">
<p>This element is used to configure the resource manager (or object
factory) used to return objects when the web application performs a
JNDI lookup operation on the corresponding resource name. You
<strong>MUST</strong> define resource parameters for every resource name
that is specified by a <code><Resource></code> element inside a
<code><Context></code> or <code><DefaultContext></code>
element in <code>$CATALINA_HOME/conf/server.xml</code>, and/or for every
name declared in a <code><resource-ref></code> or
<code><resource-env-ref></code> element in the web application
deployment descriptor, before that resource can be successfully
accessed.</p>
<p>Resource parameters are defined by name, and the precise set of
parameter names supported depend on the resource manager (or object
factory) you are using - they must match the names of settable JavaBeans
properties on the corresponding factory class. The JNDI implementation
will configure an instance of the specified factory class specified by
calling all the corresponding JavaBeans property setters, and then
making the factory instance available via the JNDI <code>lookup()</code>
call.</p>
<p>The resource parameters for a JDBC data source might look something
like this:</p>
<source>
<GlobalNamingResources ...>
...
<ResourceParams name="jdbc/EmployeeDB">
<parameter>
<name>driverClassName</name>
<value>org.hsql.jdbcDriver</value>
</parameter>
<parameter>
<name>driverName</name>
</value>jdbc:HypersonicSQL:database</value>
</parameter>
<parameter>
<name>user</name>
<value>dbusername</value>
</parameter>
<parameter>
<name>password</name>
<value>dbpassword</value>
</parameter>
</ResourceParams>
...
</GlobalNamingResources>
</source>
<p>If you need to specify the Java class name of a factory class for a
particular resource type, use a <code><parameter></code> entry
named <code>factory</code> nested inside the
<code><ResourceParams></code> element.</p>
<p>The valid attributes of a <code><ResourceParams></code> element
are as follows:</p>
<attributes>
<attribute name="name" required="true">
<p>The name of the resource being configured, relative to the
<code>java:comp/env</code> contxt. This name <strong>MUST</strong>
match the name of a resource defined by a <code><Resource></code>
element in <code>$CATALINA_HOME/conf/server.xml</code>, and/or
referenced in a <code><resource-ref></code> or
<code><resource-env-ref></code> element in the web application
deployment descriptor.</p>
</attribute>
</attributes>
</subsection>
</section>
</body>
</document>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>