camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dermoritz <tantea...@hotmail.com>
Subject Where to do context setup stuff in a guice enabled camel app
Date Tue, 25 Nov 2014 09:10:05 GMT
i am using guice in conjunction with "CamelModule" in my camel application
(standalone using Main). In my case i need to do some things on the context
before starting it:

context.addRoutePolicyFactory(startUpLogic);
context.getRegistry(JndiRegistry.class).bind(CepModule.LOOKUP_DATASOURCE,
ds);

But i am not sure where to put this lines. At the moment this lines are
added in constructor of my main RouteBuilder that is adding all other
RoutBuilders. (do context setup stuff in route builder feels wrong)
Alternativly i could put this lines into this method (mandatory if using
CepModule)
    @Provides
    @Inject
    private Set<RoutesBuilder> getRoutes(final RouteBuilder routes) 

I just would inject context but it also feels wrong to do this here. So is
there a good way/practice to hook into before starting and doing this kind
of setup?

thanks in advance





--
View this message in context: http://camel.465427.n5.nabble.com/Where-to-do-context-setup-stuff-in-a-guice-enabled-camel-app-tp5759574.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message