You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add OpEnvironment API to Generate OpInfos from a Collection/Array of Classes #80
We need to replace the functionality of SciJava Common's plugin framework. The best way I can think of is to use ServiceLoader to declare some OpEnvironmentFactory implementations, which are capable of returning an OpEnvironment. This OpEnvironmentFactory should have:
A method OpEnvironment create()
Some prioritization mechanism allowing us to choose a single OpEnvironment when given multiple OpEnvironmentFactory objects without having to hardcode an implementation class.
The problem with this implementation is that it becomes extremely difficult to modify the OpEnvironment. Currently, the only functionality available is register(OpInfo info), which is not helpful when we will no longer have access to the OpInfoGenerators and Discoverers created by the OpEnvironmentFactory.
What we need is a more powerful API for adding Ops to the OpEnvironment. For now, I like the idea of
Such functionality should be able to parse a set of OpInfos from each of the elements of classes and insert them into the op directory of the OpEnvironment. Issues to implementing such API:
The OpInfoGenerators cannot generate a List<OpInfo> from a Class, but only from a Discoverer (which it holds as its state). OpInfoGenerators should instead have a (static?) method that takes a Collection<? extends Class<?>> and returns a List<OpInfo>. OpInfoGenerators use the functionality of Discoverer, however, so that must be reconciled.
DefaultOpEnvironment lazily initializes its opDirectory, which causes a nightmare when trying to add new Ops. Currently, any call to register(OpInfo) will populate the entire opDirectory (which, depending on the Discoverers available, can take a while). We need to refactor the DefaultOpEnvironment to be smarter.
Discoverer has two different methods, implsOfType() and elementsTaggedWith(). We need a wrapper that can combine the returns from both methods, returning a List<Class<?>> that can be passed to the OpInfoGenerators.
Activity
Rework discovery toward SJC2 removal
Merge pull request #80 from scijava/scijava/scijava-ops-engine/global…