You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "William Colen (JIRA)" <ji...@apache.org> on 2012/07/13 20:53:35 UTC

[jira] [Commented] (OPENNLP-500) Improve OSGi support for OpenNLP extensions

    [ https://issues.apache.org/jira/browse/OPENNLP-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413953#comment-13413953 ] 

William Colen commented on OPENNLP-500:
---------------------------------------

Modified the ToolFactory and related classes subclasses to use ExtensionLoader. Now extensions using the BaseToolFactory should work in OSGi.
                
> Improve OSGi support for OpenNLP extensions
> -------------------------------------------
>
>                 Key: OPENNLP-500
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-500
>             Project: OpenNLP
>          Issue Type: Improvement
>            Reporter: Joern Kottmann
>            Assignee: Joern Kottmann
>             Fix For: tools-1.5.3
>
>
> We have very basic OSGi support currently. We simply export all the packages we have and don't use any other OSGi features. This works well for anything we do, expect the places where we try to access classes by class name, e.g. to load custom factories via Class.forName(...). Most users will just be happy with that.
> Such calls do not work in an OSGi environment because the class we try to load is not on "our" class path.
> In OSGi this is done via services and we need to use them if we are running in an OSGI environment.
> Anyway, OpenNLP needs to work with and without OSGi.
> I suggest that we make OSGi an optional dependency and write code which can detect if the OSGi classes are there or not.
> To instantiate a user class we would need to do something like this:
> - Try to load via Class.forName(...)
> - If cannot be found, check if running in an OSGi environment
> - If so try to get an OSGi service which provides an instance to the user class 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira