Lazily create schema context in GlobalBundleScanning* 57/28057/4
authorTom Pantelis <tpanteli@brocade.com>
Tue, 6 Oct 2015 21:44:10 +0000 (17:44 -0400)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 3 Dec 2015 15:12:42 +0000 (15:12 +0000)
commitb5d0cd043394f9ef5865324c340b2d1cd78cb639
tree93cc12121cd5bb9e21b8f7ce0240ae68b79b9953
parent02ac3376939ea07b995cac777213712f1209fbc6
Lazily create schema context in GlobalBundleScanning*

On GlobalBundleScanningSchemaServiceImpl startup, it calls
tryToUpdateSchemaContext when bundleTracker.open() completes.
This parses and creates a schema context and notifies listeners
of the updated schema context. However we don't have to call
tryToUpdateSchemaContext in start() unless there actually are
listeners registered as the purpose of tryToUpdateSchemaContext
is to update listeners. So made this change. It's not likely there
would be any listeners at that point anway.

I also changed the synchronization so as not to synchronize on 'this'
or the class instance as both are unsafe (users could sync on the
instance causing unwanted contention, either innocently or maliciously).

Change-Id: I435358b0851671b7fbfdc9784577c91ff20556df
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/GlobalBundleScanningSchemaServiceImpl.java