View | Details | Raw Unified | Return to bug 61810
Collapse All | Expand All

(-)java/org/apache/catalina/loader/WebappClassLoaderBase.java (-2 / +21 lines)
Lines 371-376 Link Here
371
     */
371
     */
372
    protected long lastJarAccessed = 0L;
372
    protected long lastJarAccessed = 0L;
373
373
374
    /**
375
     * The interval in milliseconds that we can keep jar files open.
376
     */
377
    protected int jarOpenInterval = 90000;
374
378
375
    /**
379
    /**
376
     * The list of local repositories, in the order they should be searched
380
     * The list of local repositories, in the order they should be searched
Lines 656-663 Link Here
656
660
657
    }
661
    }
658
662
663
    /**
664
     * Set the interval to keep all jar files open
665
     * @param jarOpenInterval the interval in milliseconds to keep jar files open
666
     */
667
    public void setJarOpenInterval(int jarOpenInterval) {
668
        this.jarOpenInterval = jarOpenInterval;
669
    }
659
670
660
    /**
671
    /**
672
     * Return the interval to keep all jar files open if no jar is accessed
673
     */
674
    public int getJarOpenInterval() {
675
        return jarOpenInterval;
676
    }
677
678
    /**
661
     * @return Returns the antiJARLocking.
679
     * @return Returns the antiJARLocking.
662
     */
680
     */
663
    public boolean getAntiJARLocking() {
681
    public boolean getAntiJARLocking() {
Lines 987-992 Link Here
987
        base.contextName = this.contextName;
1005
        base.contextName = this.contextName;
988
        base.hasExternalRepositories = this.hasExternalRepositories;
1006
        base.hasExternalRepositories = this.hasExternalRepositories;
989
        base.searchExternalFirst = this.searchExternalFirst;
1007
        base.searchExternalFirst = this.searchExternalFirst;
1008
        base.jarOpenInterval = this.jarOpenInterval;
990
    }
1009
    }
991
1010
992
1011
Lines 2176-2183 Link Here
2176
    public void closeJARs(boolean force) {
2195
    public void closeJARs(boolean force) {
2177
        if (jarFiles.length > 0) {
2196
        if (jarFiles.length > 0) {
2178
                synchronized (jarFiles) {
2197
                synchronized (jarFiles) {
2179
                    if (force || (System.currentTimeMillis()
2198
                    if (force || (jarOpenInterval > 0 && System.currentTimeMillis()
2180
                                  > (lastJarAccessed + 90000))) {
2199
                            > (lastJarAccessed + jarOpenInterval))) {
2181
                        for (int i = 0; i < jarFiles.length; i++) {
2200
                        for (int i = 0; i < jarFiles.length; i++) {
2182
                            try {
2201
                            try {
2183
                                if (jarFiles[i] != null) {
2202
                                if (jarFiles[i] != null) {
(-)java/org/apache/catalina/loader/WebappLoader.java (+20 lines)
Lines 137-142 Link Here
137
     */
137
     */
138
    private boolean delegate = false;
138
    private boolean delegate = false;
139
139
140
    /**
141
     * The interval in milliseconds to keep all jar files open if no jar is accessed
142
     */
143
    private int jarOpenInterval = 90000;
140
144
141
    /**
145
    /**
142
     * The descriptive information about this Loader implementation.
146
     * The descriptive information about this Loader implementation.
Lines 282-289 Link Here
282
286
283
    }
287
    }
284
288
289
    /**
290
     * The interval to keep all jar files open if no jar is accessed
291
     *
292
     * @param jarOpenInterval The new interval
293
     */
294
    public void setJarOpenInterval(int jarOpenInterval) {
295
        this.jarOpenInterval = jarOpenInterval;
296
    }
285
297
286
    /**
298
    /**
299
     * Return the interval to keep all jar files open if no jar is accessed
300
     */
301
    public int getJarOpenInterval() {
302
        return jarOpenInterval;
303
    }
304
305
    /**
287
     * Return descriptive information about this Loader implementation and
306
     * Return descriptive information about this Loader implementation and
288
     * the corresponding version number, in the format
307
     * the corresponding version number, in the format
289
     * <code>&lt;description&gt;/&lt;version&gt;</code>.
308
     * <code>&lt;description&gt;/&lt;version&gt;</code>.
Lines 580-585 Link Here
580
        try {
599
        try {
581
600
582
            classLoader = createClassLoader();
601
            classLoader = createClassLoader();
602
            classLoader.setJarOpenInterval(this.jarOpenInterval);
583
            classLoader.setResources(container.getResources());
603
            classLoader.setResources(container.getResources());
584
            classLoader.setDelegate(this.delegate);
604
            classLoader.setDelegate(this.delegate);
585
            classLoader.setSearchExternalFirst(searchExternalFirst);
605
            classLoader.setSearchExternalFirst(searchExternalFirst);
(-)java/org/apache/catalina/loader/mbeans-descriptors.xml (+8 lines)
Lines 169-174 Link Here
169
             writeable="false" 
169
             writeable="false" 
170
                 type="java.lang.String"/>
170
                 type="java.lang.String"/>
171
171
172
    <attribute   name="jarOpenInterval"
173
                 description="The interval in milliseconds to keep all jar files open if no jar is accessed"
174
                 type="int"/>
175
172
  </mbean>
176
  </mbean>
173
177
174
  <mbean         name="ParallelWebappClassLoader"
178
  <mbean         name="ParallelWebappClassLoader"
Lines 213-218 Link Here
213
             writeable="false" 
217
             writeable="false" 
214
                 type="java.lang.String"/>
218
                 type="java.lang.String"/>
215
219
220
    <attribute   name="jarOpenInterval"
221
                 description="The interval in milliseconds to keep all jar files open if no jar is accessed"
222
                 type="int"/>
223
216
  </mbean>
224
  </mbean>
217
225
218
</mbeans-descriptors>
226
</mbeans-descriptors>

Return to bug 61810