Class 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 Detail

      • StaticResourceProvider

        public StaticResourceProvider()
    • 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 resource
        content - the information about the static resource to keep in 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 interface StaticResourceProviderMBean
        Parameters:
        resourceName - the identifying name of the static resource