This time the target is pebbles DAO layer. Pretty straight forward:
- create a bundle
dao
for the already available interfaces innet.sourceforge.pebble.dao
- create a bundle
net.sourceforge.pebble.dao.file
for the file based implementation.
With the following relevant parts in the MANIFEST.MF
:
Require-Bundle: net.sourceforge.pebble."bundle-version";[2.3.2,2.4.0)",
net.sourceforge.pebble;bundle-versin=[2.3.2,2.4.0)",
net.sourceforge.pebble.dao;bundle-version="[2.3.2,2.4.0)"
Export-Package: net.sourceforge.pebble.dao
The configuration
<bean id="blogEntryDao" class="pebble.dao.file.FileBlogEntryDAO" />
<bean id="categoryDao" class="net.sourceforge.dao.file.FileCategoryDAO" />
<bean id="refererFilterDao" class="net.sourceforge.pebble.dao.file.FileRefererFilterDAO" />
<bean id="staticPageDao" class="net.sourceforge.pebble.dao.file.FileStaticPageDAO" />
<osgi:service ref="blogEntryDao" interface="net.sourceforge.pebble.dao.BlogEntryDAO" />
<osgi:service ref="categoryDao" interface="net.sourceforge.pebble.dao.CategoryDAO" />
<osgi:service ref="refererFilterDao" interface="net.sourceforge.pebble.dao.RefererFilterDAO" />
<osgi:service ref="staticPageDao" interface="net.sourceforge.pebble.dao.StaticPageDAO" />
The first mayor step forward to a modular blog software.
This post is part of a series about an OSGi experiment: Migrate a monolith to a modular OSGi application architecture.
▷ The Beginning of an OSGi Experiment
▷ Building OSGi ready pebble with Maven
▷ Extracting the first OSGi bundle
▷ ...
Header cover Photo by Matthew Henry from Burst