Hi! This sounds like a good enhancement. Feel free to create a pull request! As I see it, for now we should continue using SpringResource annotation (even if it injects non-spring resources), but at the same time create a new annotation (maybe something like @IgniteInject, I am bad with naming) and deprecate SpringResource annotation. Both annotations should work exactly the same. Then we will have a spring version of injector interface and some generic version that any user can extend and use without spring. WDYT?
P.S. You can create a JIRA ticket and mention me there, I'll be happy to review and merge your PR Kind regards, Semyon. > Hello, > I would like to bring a proposal for Ignite to include support for > @SpringResource without spring at all. > We currently use ignite without Spring Framework and, to make things > harder, under OSGi. As a part of exercise couple weeks ago I implemented > support for IoC [1] in environment we run. I did it by simulating > spring's ApplicationContext instance expected by IgnitionEx [2] and > GridSpringResourceContext. > > Turns out that Ignite IoC is fine with below API: > public interface BeanRegistry { > <T> T lookup(Class<T> type); > Object lookup(String name); > } > > Given that we look forward to keep use of Ignite I was asked to > contribute my work back to your project. > Would you be up to discuss, and if agreed, guide me on a shape of ioc > updates which would best fit Ignite itself? If you do not expect changes > in Spring integration then, maybe we could get a working solution within > ignite-osgi itself? > > Best, > Łukasz > > [1] > https://github.com/OpenNMS/horizon-stream/tree/develop/minion/minion-taskset/taskset-worker/src/main/java/org/opennms/horizon/minion/taskset/worker/ignite/resource > > [2] > https://github.com/OpenNMS/horizon-stream/blob/develop/minion/minion-taskset/taskset-worker/src/main/java/org/opennms/horizon/minion/taskset/worker/ignite/IgnitionFactory.java#L15