com.sun.faces.application.resource.ResourceCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jakarta.faces Show documentation
Show all versions of jakarta.faces Show documentation
EE4J Compatible Implementation for Jakarta Faces API
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.faces.application.resource;
import static com.sun.faces.util.Util.notNull;
import static java.util.logging.Level.FINE;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import com.sun.faces.config.WebConfiguration;
import com.sun.faces.config.WebConfiguration.WebContextInitParameter;
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.MultiKeyConcurrentHashMap;
import jakarta.servlet.ServletContext;
/**
*
* This is the caching mechanism for caching ResourceInfo instances to offset the cost of looking up the resource.
*
*
*
* This cache uses a background thread to check for modifications to the underlying webapp or JAR files containing
* resources. This check is periodic, configurable via context init param
* com.sun.faces.resourceUpdateCheckPeriod
. Through this config option, the cache can also be made static
* or completely disabled. If the value of of this option is 0
, then no check will be made making the cache
* static. If value of this option is less than 0
, then no caching will be perfomed. Otherwise, the value
* of the option will be the number of minutes between modification checks.
*
*/
public class ResourceCache {
private static final Logger LOGGER = FacesLogger.RESOURCE.getLogger();
/**
* The ResourceInfo cache.
*/
private MultiKeyConcurrentHashMap
© 2015 - 2025 Weber Informatics LLC | Privacy Policy