echoxul.view.locator
Class CachingViewLocator

java.lang.Object
  extended byechoxul.view.ViewLocator
      extended byechoxul.view.locator.BaseViewLocator
          extended byechoxul.view.locator.DelegatingViewLocator
              extended byechoxul.view.locator.CachingViewLocator

public class CachingViewLocator
extends DelegatingViewLocator

An extension of DelegatingViewLocator which caches all returned Views. If a View exists in the cache, it is not reloaded.

Author:
Terry Laurenzo

Field Summary
 
Fields inherited from class echoxul.view.ViewLocator
ATTRIBUTE_NAME
 
Constructor Summary
CachingViewLocator(ResourceLocator[] rl)
          Equivilent to the two-arg ctor with "false" passed for disableCaching
CachingViewLocator(ResourceLocator[] rl, boolean disableCaching)
          A ViewLocator which searches the list of ResourceLocators.
 
Method Summary
 void clearCache()
          Can be called programatically to clear the cache
 View lookupView(java.lang.String path)
          Looks up a (potentially cached) view from the list of ViewResolvers registered with this instance.
 
Methods inherited from class echoxul.view.locator.BaseViewLocator
loadXULView, lookupView
 
Methods inherited from class echoxul.view.ViewLocator
getInstance, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingViewLocator

public CachingViewLocator(ResourceLocator[] rl)
Equivilent to the two-arg ctor with "false" passed for disableCaching

Parameters:
rl -

CachingViewLocator

public CachingViewLocator(ResourceLocator[] rl,
                          boolean disableCaching)
A ViewLocator which searches the list of ResourceLocators. If disableCaching is true, then this class will behave just like DelegatingViewLocator. This flag is present to allow for easy disabling of caching for development.

Parameters:
rl - ResourceLocators for base class
disableCaching - To disable caching
Method Detail

clearCache

public void clearCache()
Can be called programatically to clear the cache


lookupView

public View lookupView(java.lang.String path)
                throws ViewNotFoundException
Description copied from class: ViewLocator
Looks up a (potentially cached) view from the list of ViewResolvers registered with this instance. The only syntax which is always supported is the one for looking up Java classpath resources. See ViewComponent for details.

TODO: Fully document this method

Overrides:
lookupView in class DelegatingViewLocator
Throws:
ViewNotFoundException
See Also:
ViewLocator.lookupView(java.lang.String)


Copyright © 2004 Terry Laurenzo. All Rights Reserved.