1ac2e8978b
The member variable "compositeFactory" that holds the "CompositeModuleHandlerFactory" instance is set in the activation method by calling the constructor of of "CompositeModuleHandlerFactory". This reference is destroyed and unset in the deactivate method. There exists DS managed multiple optional references to "ModuleHandlerFactory". The "add" logic does not touch the "compositeFactory" variable. The "remove" logic checks if the given service reference is a "CompositeModuleHandlerFactory" and unsets the "compositeFactory" member variable. If e.g. a module handler factory is injected that also implements the CompositeModuleHandlerFactory the CompositeModuleHandlerFactory created by the activate method is still be used. If that specific module handler factory is removed again, the variable "compositeFactory" is unset and there is NO CompositeModuleHandlerFactory present anymore. There are two options: * The instance created in the activate method should be used as long as no other one is injected. * The instance created in the activate method should be used all the time. The whole code base does not contain another specific implementation for CompositeModuleHandlerFactory, so there is no (at least in openHAB Core) change that a CompositeModuleHandlerFactory is injected. So instead of adding a non deterministic usage of "some" composite module handler factory (which will require a fix of the "set module handler factory method" and some others), let's drop the buggy code in the "remove module handler factory" and use the manually created composite module handler factory all the time. Signed-off-by: Markus Rathgeb <maggu2810@gmail.com> |
||
---|---|---|
bom | ||
bundles | ||
demo | ||
features | ||
itests | ||
licenses/epl-2.0 | ||
notes | ||
tools | ||
.gitignore | ||
.travis.yml | ||
CONTRIBUTING.md | ||
LICENSE | ||
NOTICE | ||
pom.xml | ||
README.md |
openHAB 2 Core bundles
This project contains core bundles of the openHAB 2 runtime.
Building and running the project is fairly easy if you follow the steps detailed below.
Please note that openHAB 2 Core is not a product itself, but a framework to build solutions on top. It is picked up by the main openHAB distribution build.
This means that what you build is primarily an artifact repository of OSGi bundles that can be used within smart home products.
1. Prerequisites
The build infrastructure is based on Maven. If you know Maven already then there won't be any surprises for you. If you have not worked with Maven yet, just follow the instructions and everything will miraculously work ;-)
What you need before you start:
- Maven3 from https://maven.apache.org/download.html
Make sure that the "mvn" command is available on your path
2. Checkout
Checkout the source code from GitHub, e.g. by running
git clone https://github.com/openhab/openhab-core.git
3. Building with Maven
To build this project from the sources, Maven takes care of everything:
- set MAVEN_OPTS to "-Xms512m -Xmx1024m"
- change into the openhab-core directory ("cd openhab-core“)
- run "mvn clean install" to compile and package all sources
If there are tests that are failing occasionally on your local build, run mvn -DskipTests=true clean install
instead to skip them.
How to contribute
If you want to become a contributor to the project, please read about contributing and check our guidelines first.