提交 a82238b8 编写于 作者: K Kohsuke Kawaguchi

Simplified by using instance methods

上级 1bc7f621
...@@ -60,7 +60,8 @@ public class NullIdDescriptorMonitor extends AdministrativeMonitor { ...@@ -60,7 +60,8 @@ public class NullIdDescriptorMonitor extends AdministrativeMonitor {
return Collections.unmodifiableList(problems); return Collections.unmodifiableList(problems);
} }
private void verify() { @Initializer(after=EXTENSIONS_AUGMENTED)
public void verify() {
Jenkins h = Jenkins.getInstance(); Jenkins h = Jenkins.getInstance();
for (Descriptor d : h.getExtensionList(Descriptor.class)) { for (Descriptor d : h.getExtensionList(Descriptor.class)) {
PluginWrapper p = h.getPluginManager().whichPlugin(d.getClass()); PluginWrapper p = h.getPluginManager().whichPlugin(d.getClass());
...@@ -81,10 +82,5 @@ public class NullIdDescriptorMonitor extends AdministrativeMonitor { ...@@ -81,10 +82,5 @@ public class NullIdDescriptorMonitor extends AdministrativeMonitor {
} }
} }
@Initializer(after=EXTENSIONS_AUGMENTED)
public static void verifyId() {
AdministrativeMonitor.all().get(NullIdDescriptorMonitor.class).verify();
}
private static final Logger LOGGER = Logger.getLogger(NullIdDescriptorMonitor.class.getName()); private static final Logger LOGGER = Logger.getLogger(NullIdDescriptorMonitor.class.getName());
} }
...@@ -27,7 +27,7 @@ public class Uptime { ...@@ -27,7 +27,7 @@ public class Uptime {
} }
@Initializer(after=InitMilestone.JOB_LOADED) @Initializer(after=InitMilestone.JOB_LOADED)
public static void init() { public void init() {
ExtensionList.lookup(Uptime.class).get(0).startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
} }
} }
...@@ -113,13 +113,11 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i ...@@ -113,13 +113,11 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i
@Initializer(fatal=false,after=InitMilestone.PLUGINS_STARTED,before=InitMilestone.EXTENSIONS_AUGMENTED) @Initializer(fatal=false,after=InitMilestone.PLUGINS_STARTED,before=InitMilestone.EXTENSIONS_AUGMENTED)
// as early as possible, but this needs to be late enough that the ConfidentialStore is available // as early as possible, but this needs to be late enough that the ConfidentialStore is available
public static void scanOnReboot() throws InterruptedException, IOException, GeneralSecurityException { public void scanOnReboot() throws InterruptedException, IOException, GeneralSecurityException {
RekeySecretAdminMonitor m = new RekeySecretAdminMonitor(); // throw-away instance FileBoolean flag = scanOnBoot;
FileBoolean flag = m.scanOnBoot;
if (flag.isOn()) { if (flag.isOn()) {
flag.off(); flag.off();
m.start(false).join(); start(false).join();
// block the boot until the rewrite process is complete // block the boot until the rewrite process is complete
// don't let the failure in RekeyThread block Jenkins boot. // don't let the failure in RekeyThread block Jenkins boot.
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册