fr.paris.lutece.portal.service.resource
Class ResourceService

java.lang.Object
  extended by fr.paris.lutece.portal.service.cache.AbstractCacheableService
      extended by fr.paris.lutece.portal.service.resource.ResourceService
All Implemented Interfaces:
CacheableService, LuteceService, java.lang.Cloneable, net.sf.ehcache.event.CacheEventListener

public abstract class ResourceService
extends AbstractCacheableService

This abstract Class provides a standard way for application to deliver resources using multiple loaders and an optional cache.

Since:
v1.4.1

Constructor Summary
protected ResourceService()
           
 
Method Summary
protected  void addLoader(java.lang.String strLoaderClassName)
          Add a new loader to the service
protected abstract  java.lang.String getLoadersProperty()
          Gets the name of the property that list all loaders
 java.lang.String getName()
          Get the service name
protected  Resource getResource(java.lang.String strId)
          Returns a resource by its Id
protected  java.util.Collection<Resource> getResources()
          Load all resources
protected  void initLoaders(java.lang.String strKey)
          Initialize loaders
protected  void setCacheKey(java.lang.String strKey)
          Defines whether the cache is enable or disable reading a property
protected  void setName(java.lang.String strName)
          Set the service name
protected  void setNameKey(java.lang.String strKey)
          Set the service name by reading a property
 
Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService
clone, dispose, enableCache, getCache, getCacheSize, getFromCache, getInfos, getKeys, getMaxElements, getMemorySize, getTimeToLive, initCache, initCache, isCacheEnable, notifyElementEvicted, notifyElementExpired, notifyElementPut, notifyElementRemoved, notifyElementUpdated, notifyRemoveAll, putInCache, resetCache
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceService

protected ResourceService()
Method Detail

getLoadersProperty

protected abstract java.lang.String getLoadersProperty()
Gets the name of the property that list all loaders

Returns:
The property key

initLoaders

protected void initLoaders(java.lang.String strKey)
Initialize loaders

Parameters:
strKey - The property key that contains all loaders class

setName

protected void setName(java.lang.String strName)
Set the service name

Parameters:
strName - The service name

getName

public java.lang.String getName()
Get the service name

Returns:
The service name

setNameKey

protected void setNameKey(java.lang.String strKey)
Set the service name by reading a property

Parameters:
strKey - The name key

setCacheKey

protected void setCacheKey(java.lang.String strKey)
Defines whether the cache is enable or disable reading a property

Parameters:
strKey - The key name of the cache

addLoader

protected void addLoader(java.lang.String strLoaderClassName)
Add a new loader to the service

Parameters:
strLoaderClassName - The loader class name

getResource

protected Resource getResource(java.lang.String strId)
Returns a resource by its Id

Parameters:
strId - The resource Id
Returns:
A resource

getResources

protected java.util.Collection<Resource> getResources()
Load all resources

Returns:
A collection of resources


Copyright © 2011 Mairie de Paris. All Rights Reserved.