File: loader.xml

package info (click to toggle)
tomcat9 9.0.95-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 45,952 kB
  • sloc: java: 371,527; xml: 67,915; jsp: 4,588; sh: 1,225; perl: 314; makefile: 18; ansic: 15
file content (170 lines) | stat: -rw-r--r-- 6,267 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="loader.html">

  &project;

  <properties>
    <author email="craigmcc@apache.org">Craig R. McClanahan</author>
    <title>The Loader Component</title>
  </properties>

<body>

<section name="Table of Contents">
<toc/>
</section>

<section name="Introduction">

  <p>The <strong>Loader</strong> element represents the <em>web
  application class loader</em> that will be used to load Java
  classes and resources for your web application.  Such
  a class loader must follow the requirements of the Servlet
  Specification, and load classes from the following locations:</p>
  <ul>
  <li>From the <code>/WEB-INF/classes</code> directory inside your
      web application.</li>
  <li>From JAR files in the <code>/WEB-INF/lib</code> directory
      inside your web application.</li>
  <li>From resources made available by Catalina to all web
      applications globally.</li>
  </ul>

  <p>A Loader element MAY be nested inside a <a href="context.html">Context</a>
  component.  If it is not included, a default Loader configuration will be
  created automatically, which is sufficient for most requirements.</p>

  <p>For a more in-depth description of the class loader hierarchy
  that is implemented by Catalina, see <a href="../class-loader-howto.html">the ClassLoader HowTo</a>.</p>

    <p><em>The description below uses the variable name $CATALINA_BASE to refer the
    base directory against which most relative paths are resolved. If you have
    not configured Tomcat for multiple instances by setting a CATALINA_BASE
    directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME,
    the directory into which you have installed Tomcat.</em></p>

</section>


<section name="Attributes">

  <subsection name="Common Attributes">

    <p>All implementations of <strong>Loader</strong>
    support the following attributes:</p>

    <attributes>

      <attribute name="className" required="false">
        <p>Java class name of the implementation to use.  This class must
        implement the <code>org.apache.catalina.Loader</code> interface.
        If not specified, the standard value (defined below) will be used.</p>
      </attribute>

      <attribute name="delegate" required="false">
        <p>Set to <code>true</code> if you want the class loader to follow
        the standard Java2 delegation model, and attempt to load classes from
        parent class loaders <strong>before</strong> looking inside the web
        application.  Set to <code>false</code> (the default) to have the
        class loader look inside the web application first, before asking
        parent class loaders to find requested classes or resources.</p>
      </attribute>

      <attribute name="reloadable" required="false">
        <p><strong>NOTE</strong> - This attribute has been deprecated in Tomcat
        9 and will be removed in Tomcat 10. Use the equivalent attribute on the
        surrounding <a href="context.html">Context</a> component.</p>

        <p>Set to <code>true</code> if you want Catalina to monitor classes in
        <code>/WEB-INF/classes/</code> and <code>/WEB-INF/lib</code> for
        changes, and automatically reload the web application if a change
        is detected.  This feature is very useful during application
        development, but it requires significant runtime overhead and is
        not recommended for use on deployed production applications.  You
        can use the <a href="../manager-howto.html">Manager</a> web
        application, however, to trigger reloads of deployed applications
        on demand.</p>

        <p><strong>NOTE</strong> - The value for this property will be
        inherited from the <code>reloadable</code> attribute you set on
        the surrounding <a href="context.html">Context</a> component,
        and any value you explicitly set here will be replaced.</p>
      </attribute>

    </attributes>

  </subsection>


  <subsection name="Standard Implementation">

    <p>The standard implementation of <strong>Loader</strong> is
    <strong>org.apache.catalina.loader.WebappLoader</strong>.
    It supports the following additional attributes (in addition to the
    common attributes listed above):</p>

    <attributes>

      <attribute name="loaderClass" required="false">
        <p>Java class name of the <code>java.lang.ClassLoader</code>
        implementation class to use. Custom implementations must extend
        <code>org.apache.catalina.loader.WebappClassLoaderBase</code>.
        </p>

        <p>If not specified, the default value is
        <code>org.apache.catalina.loader.ParallelWebappClassLoader</code>. The
        default <strong>loaderClass</strong> is parallel capable, which
        means that multiple threads may load difference classes in parallel.
        A non-parallel capable <strong>loaderClass</strong> is available and can
        be used by specifying
        <code>org.apache.catalina.loader.WebappClassLoader</code>.</p>
      </attribute>

    </attributes>

  </subsection>

</section>


<section name="Nested Components">

  <p>No components may be nested inside a <strong>Loader</strong> element.</p>

</section>


<section name="Special Features">

  <subsection name="Logging">

    <p>A loader is associated with the log category based on its classname.</p>

  </subsection>

</section>


</body>


</document>