BUG-2459: use thread-local cache of transformers
authorRobert Varga <rovarga@cisco.com>
Tue, 2 Dec 2014 19:01:53 +0000 (20:01 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 12 Dec 2014 12:41:34 +0000 (12:41 +0000)
commit0f85f6dee266cb9f9272c6f045e0b65c977227e6
treef05f1221550ec78a5b36253c929b40270766bc06
parent420c82964905a1adc21f4107e5a620f0b402fa95
BUG-2459: use thread-local cache of transformers

As it turns out, we can reuse transformers in the encode path. Do
precisely that, keeping them in thread-local variables. This is safe in
context of Netty, as we are invoked only from the netty threadpool. This
has the benefit of reusing the transformers across all sessions
associated with the threadpool.

Change-Id: If57933f68a9c9196b649baea17353fd2bd472e09
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToEXIEncoder.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ThreadLocalTransformers.java [new file with mode: 0644]