Avoid nullpointer exception on starting up the TopologyProvider and the InventorReadA... 99/5699/2
authorMoiz Raja <moraja@cisco.com>
Thu, 20 Mar 2014 19:58:16 +0000 (12:58 -0700)
committerMoiz Raja <moraja@cisco.com>
Thu, 27 Mar 2014 18:58:57 +0000 (11:58 -0700)
commitfd71304db951e0c7c732f98313f8fa32843f8df9
treef3ba5695627f09618e86635b09ec97445170fa28
parent1cc487a77045f64e66ba37f365de578ce27d0536
Avoid nullpointer exception on starting up the TopologyProvider and the InventorReadAdapter

The TopologyProvider and InventoryAndReadAdapter are Felix services which get started when all it's
dependencies are resolved (that is their start method gets called). The MD-SAL DataProviderService is not
or cannot be injected into them and so when start is called and the dataProviderService is used it throws an NPE

To fix this I simply moved most of the startup code into a separate method which I then call from the ComponentActivator
instead of start

Change-Id: Ia6f0b6cebd38f4af7f03c9da8a5e26e05c13f664
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyProvider.xtend