no.sesat.search.view.velocity
Class QuickResourceManagerImpl

java.lang.Object
  extended by org.apache.velocity.runtime.resource.ResourceManagerImpl
      extended by no.sesat.search.view.velocity.QuickResourceManagerImpl
All Implemented Interfaces:
org.apache.velocity.runtime.resource.ResourceManager

public final class QuickResourceManagerImpl
extends org.apache.velocity.runtime.resource.ResourceManagerImpl

A quicker replacement for ResourceManagerImpl that avoids doing resource loading and parsing while holding a global exclusive lock. This implementation creates new resource instances instead of updating existing ones and loads and parses them in the background. This removes the need for locking and the only synchronization done is whatever synchronization measures the cache is taking. Resources not yet in the cache are loaded synchronously. The reduced locking is achieved at the expense of resources possibly getting loaded several times during startup or reload.

Version:
$Id: QuickResourceManagerImpl.java 7225 2009-04-09 00:32:20Z ssmiweve $

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
globalCache, log, RESOURCE_CONTENT, RESOURCE_TEMPLATE, resourceLoaders, rsvc
 
Constructor Summary
QuickResourceManagerImpl()
           
 
Method Summary
 org.apache.velocity.runtime.resource.Resource getResource(String name, int type, String encoding)
           Overridden to layer caching capabilities.
 
Methods inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
getLoaderNameForResource, getResource, initialize, loadResource, refreshResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickResourceManagerImpl

public QuickResourceManagerImpl()
Method Detail

getResource

public org.apache.velocity.runtime.resource.Resource getResource(String name,
                                                                 int type,
                                                                 String encoding)
                                                          throws Exception
Overridden to layer caching capabilities.

Specified by:
getResource in interface org.apache.velocity.runtime.resource.ResourceManager
Overrides:
getResource in class org.apache.velocity.runtime.resource.ResourceManagerImpl
Throws:
Exception


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.