Package org.openbravo.client.kernel
Class StaticResourceProvider
- java.lang.Object
-
- org.openbravo.client.kernel.StaticResourceProvider
-
- All Implemented Interfaces:
StaticResourceProviderMBean
@ApplicationScoped public class StaticResourceProvider extends Object implements StaticResourceProviderMBean
This class is used as a cache for the static resources (js and css) used in the application. It keeps the information needed to make use of those resources without the need of generating them again.
-
-
Constructor Summary
Constructors Constructor Description StaticResourceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getCachedStaticResourceKeys()
String
getStaticResourceCachedFileName(String resourceName)
Returns the file name of a particular static resource whose identifying name is passed as parameter, if the file exists.String
getStaticResourceCachedInfo(String resourceName)
Returns the information stored for a particular static resource whose identifying name is passed as parameter.List<String>
getStaticResourceFileNames()
void
putStaticResourceCachedInfo(String resourceName, String content)
Stores the information related to a particular static resource.void
removeAllStaticResourceCachedInfo()
Removes all the cached information of the static resources.void
removeStaticResourceCachedInfo(String resourceName)
Removes the cached information related to a static resource whose identifying name is passed as parameter.
-
-
-
Method Detail
-
getStaticResourceCachedInfo
public String getStaticResourceCachedInfo(String resourceName)
Returns the information stored for a particular static resource whose identifying name is passed as parameter.- Parameters:
resourceName
- the identifying name of the static resource- Returns:
- a String with information of the static resource
-
getStaticResourceCachedFileName
public String getStaticResourceCachedFileName(String resourceName)
Returns the file name of a particular static resource whose identifying name is passed as parameter, if the file exists. If the file does not exists, this method returns null and removes the mapping of the static resource.- Parameters:
resourceName
- the identifying name of the static resource- Returns:
- a String with information of the static resource
-
putStaticResourceCachedInfo
public void putStaticResourceCachedInfo(String resourceName, String content)
Stores the information related to a particular static resource.- Parameters:
resourceName
- the identifying name of the static resourcecontent
- the information about the static resource to keep in cache
-
getCachedStaticResourceKeys
public Set<String> getCachedStaticResourceKeys()
- Specified by:
getCachedStaticResourceKeys
in interfaceStaticResourceProviderMBean
- Returns:
- a Set with the keys used in the static resources cache.
-
removeStaticResourceCachedInfo
public void removeStaticResourceCachedInfo(String resourceName)
Removes the cached information related to a static resource whose identifying name is passed as parameter.- Specified by:
removeStaticResourceCachedInfo
in interfaceStaticResourceProviderMBean
- Parameters:
resourceName
- the identifying name of the static resource
-
removeAllStaticResourceCachedInfo
public void removeAllStaticResourceCachedInfo()
Removes all the cached information of the static resources.- Specified by:
removeAllStaticResourceCachedInfo
in interfaceStaticResourceProviderMBean
-
getStaticResourceFileNames
public List<String> getStaticResourceFileNames()
- Specified by:
getStaticResourceFileNames
in interfaceStaticResourceProviderMBean
- Returns:
- a List with the names of the files that contain static resources.
-
-