Skip to content
Permalink
Browse files
[FIXED JENKINS-15869] When running on Java 5, must still load DiskSpa…
…ceMonitor/TemporarySpaceMonitor, even though they will show N/A.

Returning null from an @extension method does not seem to work reliably, and is not supported by SezPoz.
If desirable to hide a monitor column in $server/computer/, add a boolean isEnabled() method interpretable in Jelly.
  • Loading branch information
jglick committed Nov 19, 2012
1 parent c60c1fe commit 8ad62f77cb429a49318444fad2191d0e08857ca6
@@ -61,6 +61,9 @@
<li class=bug>
Build records were broken if timezone was changed while running.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15816">issue 15816</a>)
<li class='major bug'>
Linkage errors trying to run Jenkins on Java 5.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15869">issue 15869</a>)
<li class=bug>
Symlink detection refinement on Java 7.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13202">issue 13202</a>)
@@ -59,9 +59,10 @@ public String getColumnCaption() {
return Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER) ? super.getColumnCaption() : null;
}

@Extension
public static final DiskSpaceMonitorDescriptor DESCRIPTOR = new DiskSpaceMonitorDescriptor() {
public String getDisplayName() {
return Messages.DiskSpaceMonitor_DisplayName();
return Functions.isMustangOrAbove() ? Messages.DiskSpaceMonitor_DisplayName() : Messages.DiskSpaceMonitor_DisplayName5();
}

protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
@@ -72,9 +73,4 @@ protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedExce
}
};

@Extension
public static DiskSpaceMonitorDescriptor install() {
if(Functions.isMustangOrAbove()) return DESCRIPTOR;
return null;
}
}
@@ -61,9 +61,10 @@ public String getColumnCaption() {
return Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER) ? super.getColumnCaption() : null;
}

@Extension
public static final DiskSpaceMonitorDescriptor DESCRIPTOR = new DiskSpaceMonitorDescriptor() {
public String getDisplayName() {
return Messages.TemporarySpaceMonitor_DisplayName();
return Functions.isMustangOrAbove() ? Messages.TemporarySpaceMonitor_DisplayName() : Messages.TemporarySpaceMonitor_DisplayName5();
}

protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
@@ -74,12 +75,6 @@ protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedExce
}
};

@Extension
public static DiskSpaceMonitorDescriptor install() {
if(Functions.isMustangOrAbove()) return DESCRIPTOR;
return null;
}

protected static final class GetTempSpace implements FileCallable<DiskSpace> {
@IgnoreJRERequirement
public DiskSpace invoke(File f, VirtualChannel channel) throws IOException {
@@ -25,8 +25,10 @@ ClockMonitor.DisplayName=Clock Difference
DiskSpaceMonitor.MarkedOffline=Making {0} offline temporarily due to the lack of disk space
DiskSpaceMonitor.MarkedOnline=Putting {0} back online as there is enough disk space again
DiskSpaceMonitor.DisplayName=Free Disk Space
DiskSpaceMonitor.DisplayName5=Free Disk Space (Java 6+)
ResponseTimeMonitor.DisplayName=Response Time
ResponseTimeMonitor.MarkedOffline=Making {0} offline because it''s not responding
ResponseTimeMonitor.TimeOut=Time out for last {0} try
SwapSpaceMonitor.DisplayName=Free Swap Space
TemporarySpaceMonitor.DisplayName=Free Temp Space
TemporarySpaceMonitor.DisplayName=Free Temp Space
TemporarySpaceMonitor.DisplayName5=Free Temp Space (Java 6+)

0 comments on commit 8ad62f7

Please sign in to comment.