make this thread-local
Merge remote-tracking branch 'opennms/1.12'