Skip to content

Jira plugin development OSGi vs SPI #512

Answered by ryber
jlahtinen asked this question in Q&A
Discussion options

You must be logged in to vote

Hrm , I have seen issues with ServiceLoader in some packaging systems before, so I've decided to introduce a couple new strategies to CoreFactory:

  1. use the java.util.ServiceLoader to load a class by looking for a meta config file in the resources. They should exist at META-INF.services/kong.unirest.core.json.JsonEngine. The ServiceLoader will use the first one it finds. see https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html

  2. It will attempt to load the engine by class name from the classloader by known names in order. These are:
    1. kong.unirest.jackson.JacksonEngine
    2. kong.unirest.gson.GsonEngine

  3. Clients may set a engine with the setEngine method like CoreFactory.…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@jlahtinen
Comment options

Comment options

You must be logged in to vote
2 replies
@jlahtinen
Comment options

@jlahtinen
Comment options

Answer selected by jlahtinen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants