From adffaces-dev-return-2056-apmail-incubator-adffaces-dev-archive=incubator.apache.org@incubator.apache.org Mon Feb 12 23:05:17 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-dev-archive@locus.apache.org Received: (qmail 96801 invoked from network); 12 Feb 2007 23:05:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2007 23:05:17 -0000 Received: (qmail 65217 invoked by uid 500); 12 Feb 2007 23:05:23 -0000 Delivered-To: apmail-incubator-adffaces-dev-archive@incubator.apache.org Received: (qmail 65199 invoked by uid 500); 12 Feb 2007 23:05:23 -0000 Mailing-List: contact adffaces-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-dev@incubator.apache.org Received: (qmail 65190 invoked by uid 99); 12 Feb 2007 23:05:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2007 15:05:23 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [148.87.113.118] (HELO rgminet01.oracle.com) (148.87.113.118) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2007 15:05:12 -0800 Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l1CN4ogu023545 for ; Mon, 12 Feb 2007 16:04:51 -0700 Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l1CMAHeY026358 for ; Mon, 12 Feb 2007 16:04:50 -0700 Received: from jwaldman-pc.us.oracle.com by rcsmt251.oracle.com with ESMTP id 2443408841171321488; Mon, 12 Feb 2007 16:04:48 -0700 Message-ID: <45D0F273.4030508@oracle.com> Date: Mon, 12 Feb 2007 15:04:19 -0800 From: Jeanne Waldman User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: adffaces-dev@incubator.apache.org Subject: [Skinning] FileSystemStyleCache code - ok to delete? References: <45CDF401.5010005@mvdb.net> In-Reply-To: <45CDF401.5010005@mvdb.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-Virus-Checked: Checked by ClamAV on apache.org I'm trying to figure out what's going on in FileSystemStyleCache regarding the caching code. I noticed that this code is not called by anyone. Does anyone object to my deleting it? Or is there some use for it so I should keep it around. /** * Returns a shared ImageProvider instance for the specified * XSS document and target cache directory. * * @param source The path of the source XSS document. The * specified file must be a valid XSS document. If the specified * file does not exists, an IllegalArgumentException is thrown. * @param target The path of the target directory. Generated * CSS files are stored in this directory. If the directory * does not exist and can not be created, an IllegalArgumentException * is thrown. */ public static StyleProvider getSharedCache( String source, String target ) { // Make sure we have some source/target. if (source == null) throw new IllegalArgumentException("No source specified."); if (target == null) throw new IllegalArgumentException("No target specified."); // First, get the key to use to look up the cache String key = _getSharedCacheKey(source, target); // See if we've got a shared cache StyleProvider cache = _sSharedCaches.get(key); // If we didn't find a shared cache, create a new cache // and cache it in the shared cache cache. :-) if (cache == null) { // Create the new cache cache = new FileSystemStyleCache(source, target); // Before we save the new cache, make sure another thread hasn't // already cached a different instance. Synchronize to lock up // _sSharedCaches. synchronized (_sSharedCaches) { StyleProvider tmp = _sSharedCaches.get(key); if (tmp != null) { // Stick with tmp cache = tmp; } else { _sSharedCaches.put(key, cache); } } } return cache; }