BUG-1281: optimize ListenerAdapter

TransformerFactory should be reused, so that's what we're doing here.
Here we do not cache the transformer, as we are called from datastore
thread, which has essentially no business in this. Same goes for
DocumentBuilderFactory.

Also, the transformation to RFC3339 timestamp was compiling the same
regex over and over, so compile it once and reuse it.

Change-Id: Ia66f42fa123bbb4f86b396520757d9bc28f7b9d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-1281: Optimized CompositeNodeWrapper

When wrapping entries, we know how many we will need, so let the
ArrayList know that.

Change-Id: Ic2fc4ef451a5cdc11a8dfebccaf5a1c605e6e66d
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-1281: optimize JSON codec

Multiple optimizations made in one go:

- do not use string concatenation for LOG.debug()
- do not use string concatenation in Preconditions.checkState()
- methods which do not need state are made static
- use chars instead of strings where possible
- do not instantiate ArrayList needlessly to access first element in a set
- optimize namespace/localname parsing by not using String.split()
- use Charset constant instead of charset name

Change-Id: If1c4ea50d7d1d2aae4f52d1dc68ff79b901208b0
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-868: donot use deprecated call

WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse() is the
replacement, so use it instead of
sendUnsupportedWebSocketVersionResponse().

Change-Id: I03116f09e757df9694ac077c9e82296eaf19de90
Signed-off-by: Robert Varga <rovarga@cisco.com>