com.raritantechnologies.searchApp.taglibrary
Class BodyCache

java.lang.Object
  extended bycom.raritantechnologies.searchApp.taglibrary.BodyCache

public class BodyCache
extends java.lang.Object

Utility class to cache the results of ICustomTag getBody( ) operations to avoid redoing the same work over and over. The getBodyCache( ) method compares the current set of request parameters sent to the getBody( ) method with the last set of parameters. If they are the same, the cached body string is returned.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
BodyCache(java.util.ArrayList requestParams)
          Constructor takes a list of request parameters that should be monitored for change.
 
Method Summary
 java.lang.String getBodyCache(RaritanPageContext rpc)
          returns the HTML String that was last set with the setLastRequest( ) method if the set of monitored HTTP parameters in the current page context are identical to those contained in set last sent to the setLastRequest( ) method.
 void setLastRequest(RaritanPageContext rpc, java.lang.String lastBody)
          Sets the last request that was sent to the ICustomTag and the last output that corresponding to the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyCache

public BodyCache(java.util.ArrayList requestParams)
Constructor takes a list of request parameters that should be monitored for change.

Method Detail

setLastRequest

public void setLastRequest(RaritanPageContext rpc,
                           java.lang.String lastBody)
Sets the last request that was sent to the ICustomTag and the last output that corresponding to the request.

Parameters:
rpc - The page request that contains the last http request.
lastBody - The last HTML segment that was returned by the Custom Tag.

getBodyCache

public java.lang.String getBodyCache(RaritanPageContext rpc)
returns the HTML String that was last set with the setLastRequest( ) method if the set of monitored HTTP parameters in the current page context are identical to those contained in set last sent to the setLastRequest( ) method.

Parameters:
rpc - The current HTTP request.