Workflow dependency injection - Guice?

69 views
Skip to first unread message

Eugene Dzhurinsky

unread,
Sep 24, 2016, 8:05:20 PM9/24/16
to COPPER Engine
Hello! I know that the engine is capable of doing some DI for Spring through Spring annotations.

Can somebody please guide me on how can I implement my own DI for Guice, keeping in mind that I already have an Injector and just need to actually "get" the instance of the Workflow class from that injector, with all its wires initialized?

Thanks!

Michael Austermann

unread,
Sep 26, 2016, 2:20:05 AM9/26/16
to copper...@googlegroups.com
You just have to implement interface "org.copperengine.core.DependencyInjector" and set it on your engine - see "org.copperengine.core.common.AbstractProcessingEngine.setDependencyInjector(DependencyInjector)"

Have a look at PojoDependencyInjector.java and SpringDependencyInjector.java as examples.

Copper will call "public void inject(Workflow<?> workflow)" on the injector for each workflow instance before it is executed.



Von: "Eugene Dzhurinsky" <jdev...@gmail.com>
An: "COPPER Engine" <copper...@googlegroups.com>
Gesendet: Sonntag, 25. September 2016 02:05:20
Betreff: [COPPER Users] Workflow dependency injection - Guice?

Hello! I know that the engine is capable of doing some DI for Spring through Spring annotations.
Can somebody please guide me on how can I implement my own DI for Guice, keeping in mind that I already have an Injector and just need to actually "get" the instance of the Workflow class from that injector, with all its wires initialized?

Thanks!


--
You received this message because you are subscribed to the Google Groups "COPPER Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copper-engin...@googlegroups.com.
To post to this group, send email to copper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copper-engine/0dfa0ef9-3cef-4d3a-b8b0-cd3838be2069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eugene Dzhurinsky

unread,
Sep 27, 2016, 12:07:10 PM9/27/16
to COPPER Engine
Michael, thanks! That is really helpful and easy to implement, actually.
Reply all
Reply to author
Forward
0 new messages