org.webmacro.resource
Class ReloadDelayDecorator
java.lang.Object
|
+--org.webmacro.resource.ReloadDelayDecorator
- public class ReloadDelayDecorator
- extends java.lang.Object
Utility class to handle creation of TimedReloadContext.
TimedReloadContext objects are used to prevent a cached resource
of being checked for modification all the time, but only checks
for in given intervals.
This class stores a mapping of protocol types to delay values.
When a provider requests to decorate a reload context it looks up
the delay for this protocol and eventually creates a suitable
TimedReloadContext.
- Author:
- Sebastian Kanthak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReloadDelayDecorator
public ReloadDelayDecorator()
init
public void init(Broker b,
Settings config)
throws InitException
- Initialize object.
Reads config settings from key "CheckForReloadDelay"
decorate
public CacheReloadContext decorate(java.lang.String protocol,
CacheReloadContext reloadContext)
- Looks up the "check for reload delay" for protocol and creates
a suitable TimedReloadContext or passes back the original
reload context if delay <= 0
- Parameters:
protocol
- protocl to look up delay forreloadContext
- reloadContext to decorate- Returns:
- eventually decorated reload context