BUG-2459: use thread-local cache of transformers 17/13317/13
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)
commitd0e96f9658459b47315b8fd6ec96060a6108e308
treea1d9da08ef66d90c4348c310121a137021b3b6bc
parent672ac242bf3acc6c9eaf80071be5f74cab8c9b3b
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]