1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.lesscss.internal.cache

File LESSCache.java

 

Code metrics

0
0
0
1
93
15
0
-
-
0
-

Classes

Class Line # Actions
LESSCache 34 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.lesscss.internal.cache;
21   
22    import org.xwiki.lesscss.internal.colortheme.ColorThemeReference;
23    import org.xwiki.lesscss.resources.LESSResourceReference;
24    import org.xwiki.lesscss.internal.skin.SkinReference;
25   
26    /**
27    * Component to cache objects computed from a LESS files contained in the skin.
28    *
29    * @param <T> class of the objects to cache
30    *
31    * @since 7.0RC1
32    * @version $Id: b941275ac35085e8ca4ba4224c876d9f330ad4eb $
33    */
 
34    public interface LESSCache<T>
35    {
36    /**
37    * Get an object from the name of the LESS source, the skin and the name of the color theme.
38    * @param lessResourceReference reference of the code to compile
39    * @param skin reference of the skin
40    * @param colorTheme reference of the color theme
41    * @return the corresponding CSS
42    */
43    T get(LESSResourceReference lessResourceReference, SkinReference skin, ColorThemeReference colorTheme);
44   
45    /**
46    * Add an object in the cache.
47    *
48    * @param lessResourceReference reference of the code to compile
49    * @param skin reference of the skin
50    * @param colorThemeName reference of the color theme
51    * @param object the object to cache
52    */
53    void set(LESSResourceReference lessResourceReference, SkinReference skin, ColorThemeReference colorThemeName,
54    T object);
55   
56    /**
57    * Clear the cache.
58    */
59    void clear();
60   
61    /**
62    * Clear all the cached content related to a skin.
63    *
64    * @param skin reference to the skin
65    */
66    void clearFromSkin(SkinReference skin);
67   
68    /**
69    * Clear all the cached content related to a color theme.
70    *
71    * @param colorTheme reference of the color theme
72    */
73    void clearFromColorTheme(ColorThemeReference colorTheme);
74   
75    /**
76    * Clear all the cached content related to a LESS resource.
77    *
78    * @param lessResourceReference reference of a LESS resource
79    */
80    void clearFromLESSResource(LESSResourceReference lessResourceReference);
81   
82    /**
83    * Create a Mutex for a cache entry, to be used by someone who need a Thread-Safe access to the cache.
84    *
85    * @param lessResourceReference a reference to a LESS resource
86    * @param skin a reference to a Skin
87    * @param colorTheme a reference to a color theme
88    * @return the mutex related to the 3 parameters
89    *
90    * @since 6.4.1
91    */
92    Object getMutex(LESSResourceReference lessResourceReference, SkinReference skin, ColorThemeReference colorTheme);
93    }