Class InternalBasicRulesCache
- java.lang.Object
-
- com.adaptris.adapter.edistream.parser.cache.InternalBasicRulesCache
-
- All Implemented Interfaces:
IRulesCache
,ComponentLifecycle
public class InternalBasicRulesCache extends java.lang.Object implements IRulesCache
Basic internal cache implementation for holding parsed grammar files
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternalBasicRulesCache.LimitedLinkedHashMap<K,V>
This class is effective a fixed size cache that retains only the newest entries.
A linked Hash Map implementation which has a Capacity Limit.
-
Constructor Summary
Constructors Constructor Description InternalBasicRulesCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGrammar(java.net.URL fileURL, java.lang.String grammarHashKey)
void
clear()
int
getCapacity()
EdiElement
getRuleGrammar(java.lang.String messageHashKey)
boolean
hasKey(java.lang.String entryKey)
boolean
hasRule(java.lang.String entryKey)
void
init()
java.lang.String
isGrammarCached(java.net.URL fileURL)
void
putRule(java.lang.String key, Message messageRule)
void
setCapacity(int limit)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, start, stop
-
-
-
-
Method Detail
-
init
public void init()
- Specified by:
init
in interfaceComponentLifecycle
-
hasKey
public boolean hasKey(java.lang.String entryKey)
- Specified by:
hasKey
in interfaceIRulesCache
-
hasRule
public boolean hasRule(java.lang.String entryKey)
- Specified by:
hasRule
in interfaceIRulesCache
-
getRuleGrammar
public EdiElement getRuleGrammar(java.lang.String messageHashKey)
- Specified by:
getRuleGrammar
in interfaceIRulesCache
-
clear
public void clear()
- Specified by:
clear
in interfaceIRulesCache
-
putRule
public void putRule(java.lang.String key, Message messageRule)
- Specified by:
putRule
in interfaceIRulesCache
-
setCapacity
public void setCapacity(int limit)
- Specified by:
setCapacity
in interfaceIRulesCache
-
getCapacity
public int getCapacity()
- Specified by:
getCapacity
in interfaceIRulesCache
-
addGrammar
public void addGrammar(java.net.URL fileURL, java.lang.String grammarHashKey)
- Specified by:
addGrammar
in interfaceIRulesCache
-
isGrammarCached
public java.lang.String isGrammarCached(java.net.URL fileURL)
- Specified by:
isGrammarCached
in interfaceIRulesCache
-
-