net.mlw.vlh.adapter
Class ValueListAdapterCacheDecorator

java.lang.Object
  extended bynet.mlw.vlh.adapter.ValueListAdapterCacheDecorator
All Implemented Interfaces:
ValueListAdapter

public class ValueListAdapterCacheDecorator
extends Object
implements ValueListAdapter

This decorator is a lazy way to implement caching. This is ideal for select boxes and the like.

Note that to make this thread safe sorting and paging must be defined in the parent ValueListAdapter

Author:
mwilson

Field Summary
 
Fields inherited from interface net.mlw.vlh.ValueListAdapter
DO_FILTER, DO_FOCUS, DO_NOTHING, DO_PAGE, DO_SORT
 
Constructor Summary
ValueListAdapterCacheDecorator()
           
 
Method Summary
 int getAdapterType()
          This method tells the Service what still needs to be done on the Collection before returning the data.
 ValueList getValueList(String name, ValueListInfo info)
          Gets a ValueList
 void setCacheTimeout(long cacheTimeout)
          Sets the duration in milliseconds to allow cached data to stick around.
 void setParent(ValueListAdapter decoratedValueListAdapter)
          The underling ValueListAdapter that retrieves the ValueList to be cached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueListAdapterCacheDecorator

public ValueListAdapterCacheDecorator()
Method Detail

getAdapterType

public int getAdapterType()
Description copied from interface: ValueListAdapter
This method tells the Service what still needs to be done on the Collection before returning the data.

Specified by:
getAdapterType in interface ValueListAdapter
Returns:
A bitwise or combination of DO_NOTHING, DO_SORT, DO_PAGE and DO_FILTER. For example:
           public int getAdapterType()
           {
             return DO_SORT | DO_PAGE;
           }
         
See Also:
ValueListAdapter.getAdapterType()

getValueList

public ValueList getValueList(String name,
                              ValueListInfo info)
Description copied from interface: ValueListAdapter
Gets a ValueList

Specified by:
getValueList in interface ValueListAdapter
Parameters:
info - The ValueList information
name - The name of the ValueList
Returns:
The ValueList
See Also:
ValueListAdapter.getValueList(java.lang.String, net.mlw.vlh.ValueListInfo)

setCacheTimeout

public void setCacheTimeout(long cacheTimeout)
Sets the duration in milliseconds to allow cached data to stick around.


setParent

public void setParent(ValueListAdapter decoratedValueListAdapter)
The underling ValueListAdapter that retrieves the ValueList to be cached.

Parameters:
decoratedValueListAdapter - The parent ValueListAdapter.


Copyright © 2003-2006 mlavilson. All Rights Reserved.