I want to develop a system in order to manage readings from a text file. The main structure is based on 4 bundles:
timestamp
for the log
log
(add the timestamp
and the values to a file)timestamp
and the readingsMy question is: How should each bundle
be organized? I'm not 100% familiar with the OSGi
way of work, it's something I'm working on. My current structure is as follows:
bundle
activator
s, where I register the service
sinterfaces
, although I'm not sure I'm supposed to implement there within the same packageIs it correct? Thanks in advance.
You're right to separate the interfaces into different packages to the implementations. Generally you'll want each bundle to export the packages containing the interfaces, but not the implementation packages. This will help to minimise the coupling between the bundles.
It looks like you have all your services in one project which would result in them all being in the same OSGi bundle. You should probably separate each one out into its own project with its own manifest file. That way the services can be developed and deployed independently and communicate through the service interfaces.