| java.lang.Object org.archive.crawler.settings.SettingsCache
SettingsCache | public class SettingsCache (Code) | | This class keeps a map of host names to settings objects.
It is implemented with soft references which implies that the elements can
be garbage collected when there's no strong references to the elements.
Even if there's no strong references left elements will not be garbage
collected unless the memory is needed.
author: John Erik Halse |
SettingsCache | public SettingsCache(CrawlerSettings globalSettings)(Code) | | Creates a new instance of the settings cache
|
clear | public void clear()(Code) | | Clear all cached settings.
|
deleteSettingsObject | public synchronized void deleteSettingsObject(CrawlerSettings settings)(Code) | | Delete a settings object from the cache.
Parameters: settings - the settings object to remove. |
getSettings | public CrawlerSettings getSettings(String host, String refinement)(Code) | | Get the effective settings for a host.
Parameters: host - the host to get settings for. the settings or null if not in cache. |
getSettingsObject | public CrawlerSettings getSettingsObject(String scope, String refinement)(Code) | | Get a settings object.
Parameters: scope - the scope of the settings object to get. the settings object or null if not in cache. |
putSettings | public synchronized void putSettings(String host, CrawlerSettings settings)(Code) | | Add a settings object to the cache.
Parameters: host - the host for which the settings object is valid. Parameters: settings - the settings object. |
refreshHostToSettings | public synchronized void refreshHostToSettings()(Code) | | Make sure that no host strings points to wrong settings.
This method clears most of the host to settings mappings. Because of the
performance penalty this should only used when really needed.
|
|
|