FAQ
+1 for utility class. +1 for optional dependency.

Aliaksandr
On Fri, Apr 13, 2012 at 2:08 PM, william.colen@gmail.com wrote:

Do you have any sample code of how to do it? Maybe we could create a
utility class with a method that does as you explained before: try to load
a class using Class.forName and if it fails it tries loading from OSGi.


On Fri, Apr 13, 2012 at 8:33 AM, Jörn Kottmann wrote:
On 04/13/2012 01:19 PM, william.colen@gmail.com wrote:

This affects the customization factories. I have never work with OSGi,
so
I
would follow your instructions.
What happens if the class we are trying to load is in another jar? This
jar
should also export packages?
The one who makes the dependency has to take care for this.

I also didn't work too much with OSGi, the OSGi bundle containing the class
needs to register a service the opennlp-tools bundle can consume.
Not sure if the package must be exported, because there is no need to
access it in any other way than via the service, even the interface it
implements
will be defined in the opennlp-tools bundle.

The customization factories currently directly call Class.forName,
this we would need to replace with our own custom mechanism as proposed.

Jörn

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 11 | next ›
Discussion Overview
groupdev @
categoriesopennlp
postedApr 13, '12 at 11:11a
activeApr 24, '12 at 11:20a
posts11
users4
websiteopennlp.apache.org

People

Translate

site design / logo © 2021 Grokbase