Switch to constructor injection in a few actions

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232552406
This commit is contained in:
mcilwain 2019-02-05 13:57:17 -08:00 committed by jianglai
parent 927e8bbd73
commit 29d3ad8052
5 changed files with 49 additions and 50 deletions

View file

@ -38,11 +38,22 @@ import javax.inject.Inject;
auth = Auth.AUTH_INTERNAL_ONLY)
public final class RefreshDnsAction implements Runnable {
@Inject Clock clock;
@Inject DnsQueue dnsQueue;
@Inject @Parameter("domainOrHostName") String domainOrHostName;
@Inject @Parameter("type") TargetType type;
@Inject RefreshDnsAction() {}
private final Clock clock;
private final DnsQueue dnsQueue;
private final String domainOrHostName;
private final TargetType type;
@Inject
RefreshDnsAction(
@Parameter("domainOrHostName") String domainOrHostName,
@Parameter("type") TargetType type,
Clock clock,
DnsQueue dnsQueue) {
this.domainOrHostName = domainOrHostName;
this.type = type;
this.clock = clock;
this.dnsQueue = dnsQueue;
}
@Override
public void run() {