|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.ser.SerializerCache
public final class SerializerCache
Simple cache object that allows for doing 2-level lookups: first level is by "local" read-only lookup Map (used without locking) and second backup level is by a shared modifiable HashMap. The idea is that after a while, most serializers are found from the local Map (to optimize performance, reduce lock contention), but that during buildup we can use a shared map to reduce both number of distinct read-only maps constructed, and number of serializers constructed.
Constructor Summary | |
---|---|
SerializerCache()
|
Method Summary | |
---|---|
void |
addSerializer(Class<?> type,
JsonSerializer<Object> ser)
Method called if none of lookups succeeded, and caller had to construct a serializer. |
JsonSerializer<Object> |
findSerializer(Class<?> type)
Method that checks if the shared (and hence, synchronized) lookup Map might have the serializer already. |
void |
flush()
|
ReadOnlyClassToSerializerMap |
getReadOnlyLookupMap()
Method that can be called to get a read-only instance populated from the most recent version of the shared lookup Map. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerializerCache()
Method Detail |
---|
public ReadOnlyClassToSerializerMap getReadOnlyLookupMap()
public JsonSerializer<Object> findSerializer(Class<?> type)
public void addSerializer(Class<?> type, JsonSerializer<Object> ser)
public int size()
public void flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |