Task installer

CoreInstallersBundle / TaskInstaller

Installs dropwizard tasks.

Recognition

Detects classes extending dropwizard Task and register their instances in environment.

public class MyTask extends Task {

    @Inject
    private MyService service;

    public TruncateDatabaseTask() {
        super("mytask");
    }

    @Override
    public void execute(ImmutableMultimap<String, String> parameters, PrintWriter output) throws Exception {
        service.doSomething();
    }
}

Task can be triggered with: http://localhost:8081/tasks/mytask