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
At the moment in order to create your own bindings, you have to create a child injector. This isn't ideal (due to bugs such as google/guice#973 - injecting an Injector will inject the parent, not the child that the module was bound with).
I actually disagree with your proposed solution - since Velocity injects all the dependencies that a plugin will receive from the proxy through the injector, the programming model is vulnerable to depending on dependencies that haven't been made available.
We might consider providing a @PluginModule annotation, and record classes with this annotation to be explicitly initialized (possibly with injection) and adding an instance of the module class to the injector Velocity will use to initialize the plugin main class though. I'm going to be marking this as an enhancement for a future Velocity release.
As a workaround, you could always create your own injector once you receive the resources provided by Velocity and inject the dependencies you need.
At the moment in order to create your own bindings, you have to create a child injector. This isn't ideal (due to bugs such as google/guice#973 - injecting an
Injector
will inject the parent, not the child that the module was bound with).I believe the logic in JavaPluginLoader#loadPlugin should be something similar to:
The text was updated successfully, but these errors were encountered: