BUG-7996: Split JSONCodec into multiple implementations 73/53373/8
authorRobert Varga <rovarga@cisco.com>
Wed, 15 Mar 2017 18:10:18 +0000 (19:10 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 23 Mar 2017 09:26:37 +0000 (10:26 +0100)
commita78442e67b5b67976ebc8291534cf004780a2446
treea53f771bf41269b5cb0465ed40466dfb59446e38
parent65b95496775cd06d576f59b3ca3948636e5c8f60
BUG-7996: Split JSONCodec into multiple implementations

Make JSONCodecFactory an abstract base class with four different
trade-offs in cpu/memory usage. The only implementation available
to clients is SharedJSONCodecFactory, which behaves exactly like
the previous implementation used to.

One user-visible change is that thread-safe implementations,
including SharedJSONCodedFactory, now keep a shared weak cache
for reuse when the same kind of factory is requested multiple times
for the same context.

Change-Id: I15342e6b4ed68ccbac9c099f63654d7456913934
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/EagerJSONCodecFactory.java [new file with mode: 0644]
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodecFactory.java
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/LazyJSONCodecFactory.java [new file with mode: 0644]
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/SharedJSONCodecFactory.java [new file with mode: 0644]
yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/SimpleJSONCodecFactory.java [new file with mode: 0644]