提交 0d937c66 编写于 作者: K kohsuke

added more convenience method

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15243 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c7bb6896
......@@ -32,6 +32,7 @@ import java.io.IOException;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.Stapler;
/**
* Checks the health of a subsystem of Hudson and if there's something
......@@ -50,6 +51,10 @@ import org.kohsuke.stapler.StaplerResponse;
* for one such example), while other times it's more convenient to do
* so by running some code periodically (for this, use {@link TimerTrigger#timer})
*
* <p>
* {@link AdministrativeMonitor}s are bound to URL by {@link Hudson#getAdministrativeMonitor(String)}.
* See {@link #getUrl()}.
*
* <h3>Views</h3>
* <dl>
* <dt>message.jelly</dt>
......@@ -85,6 +90,13 @@ public abstract class AdministrativeMonitor implements ExtensionPoint {
this.id = this.getClass().getName();
}
/**
* Returns the URL of this monitor, relative to the context path, like "administrativeMonitor/foobar".
*/
public String getUrl() {
return "administrativeMonitor/"+id;
}
/**
* Mark this monitor as disabled, to prevent this from showing up in the UI.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册