-
Notifications
You must be signed in to change notification settings - Fork 6
ServiceLoader-based Discoverer #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
NB: An answer to the question: "Why must this depend on SciJava Ops SPI?:The big reason is to be able to discover The
One downside of (1) is that we may pick up For these reasons, it is simplest to just use |
793f41a to
df5acfb
Compare
df5acfb to
fc9874d
Compare
fc9874d to
ededd13
Compare
Adds a Discoverer responsible for looking up implementations via ServiceLoader
It is unfortunate to make this change on this branch, but after writing SciJava Ops ServiceLoader, it became clear that SciJava Ops Discovery has nothing to do with Ops. Thus it becomes SciJava Discovery (without the "Ops). SciJava Ops ServiceLoader, however, needs the Ops name because of its module-info.java
Man, that's a mouthful
ededd13 to
f08cb58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a great first step toward using ServiceLoader as an option for discovery of ops. We have discussed and iterated the design several times since then, but the latter work is built on this first iteration, so I am merging this as is, with the understanding that the ServiceLoader-based discovery evolves substantially from this point forward.
This PR introduces a
ServiceLoader-basedDiscoverer, currently able to discoverOps andOpCollections. Suppose we want make a classFooOpin modulecom.example.foodiscoverable byServiceLoaderDiscoverer; this can be accomplished by following these steps:ClsimplementOporOpCollection:module-info.java,provideOpwithCls:This PR also adds
OpClassto the SPI module, intended to house Op metadata normally stored in a@Pluginannotation, as well as an Op implementation in the SciJava Ops Engine module as a proof of concept.TODO:
OporOpCollectionthat is not declared in themodule-info. This should be enforced via a Maven plugin