Hi all,

I am currently trying to setup a quartz scheduled job which requires some 
dependencies (DB connection, jersey HTTP client).

Originally I had this job triggered manually as a HTTP endpoint and it was 
easy to create an instance of the dependencies like so:


@Override
public void run(final ShepherdServiceConfiguration config,
    final Environment environment) {

    final DBIFactory factory = new DBIFactory();
    final DBI jdbi = factory
        .build(environment, config.getDataSourceFactory(), "testDB");

    //quartz job
    final Client client = new 
JerseyClientBuilder(environment).using(config.getJerseyClientConfiguration())
        .build(getName());

    final ReportClient reportClient = new ReportClientJerseyImpl(client, 
config.getReportProxy().getTargetUri());



Following the documentation set out here : 
https://github.com/spinscale/dropwizard-jobs, I have tried to add my 
dependencies for the scheduled job through the initialise method.

However I am having trouble understanding how to do the same during the 
initialise() phase of Dropwizard. 

Are my config and envrionment objects not available at this point in time? 
How can I setup a DB connection or an object that requires values from the 
config.yaml?

Any help is appreciated, thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to