Class ResourceManagerImpl

  • All Implemented Interfaces:
    ResourceManager

    public class ResourceManagerImpl
    extends Object
    implements ResourceManager

    A default implementation of the ResourceManager interface.

    This class provides a fully functional ResourceManager implementation that can be used as is. There is usually no need to subclass this class or use a different implementation.

    The class uses the associated ResourceLoader to retrieve requested resources or resource groups. No caching is performed, this can be done in the ResourceLoader.

    Implementation note: This class is thread-safe.

    Version:
    $Id: ResourceManagerImpl.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • ResourceManagerImpl

        public ResourceManagerImpl()
        Creates a new instance of ResourceManagerImpl.
      • ResourceManagerImpl

        public ResourceManagerImpl​(ResourceLoader loader)
        Creates a new instance of ResourceManagerImpl and initializes the associated resource loader.
        Parameters:
        loader - the resource loader to use
    • Method Detail

      • setResourceLoader

        public void setResourceLoader​(ResourceLoader resourceLoader)
        Sets the ResourceLoader to use. Requests for resource groups are delegated to this object.
        Specified by:
        setResourceLoader in interface ResourceManager
        Parameters:
        resourceLoader - the ResourceLoader to use
      • fetchLoader

        protected ResourceLoader fetchLoader()
        Fetches the resource loader. This method is called whenever access to a resource loader is needed. It checks if a resource loader is defined and if not, throws an exception.
        Returns:
        the resource loader to use
      • getDefaultResourceGroup

        public Object getDefaultResourceGroup()
        Returns the name of the default resource group.
        Specified by:
        getDefaultResourceGroup in interface ResourceManager
        Returns:
        the name of the default resource group
      • setDefaultResourceGroup

        public void setDefaultResourceGroup​(Object grp)
        Sets the name of the default resource group.
        Specified by:
        setDefaultResourceGroup in interface ResourceManager
        Parameters:
        grp - the name of the default resource group