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

added callbacks to notify when a node goes temporarily offlien

上级 dd0f362e
......@@ -41,6 +41,7 @@ import hudson.security.Permission;
import hudson.security.PermissionGroup;
import hudson.security.PermissionScope;
import hudson.slaves.ComputerLauncher;
import hudson.slaves.ComputerListener;
import hudson.slaves.RetentionStrategy;
import hudson.slaves.WorkspaceList;
import hudson.slaves.OfflineCause;
......@@ -539,6 +540,10 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
synchronized (statusChangeLock) {
statusChangeLock.notifyAll();
}
for (ComputerListener cl : ComputerListener.all()) {
if (temporarilyOffline) cl.onTemporarilyOffline(this,cause);
else cl.onTemporarilyOnline(this);
}
}
@Exported
......
......@@ -164,6 +164,21 @@ public abstract class ComputerListener implements ExtensionPoint {
*/
public void onOffline(Computer c) {}
/**
* Indicates that the computer was marked as temporarily online by the administrator.
* This is the reverse operation of {@link #onTemporarilyOffline(Computer)}
*
* @since 1.452
*/
public void onTemporarilyOnline(Computer c) {}
/**
* Indicates that the computer was marked as temporarily online by the administrator.
* This is the reverse operation of {@link #onTemporarilyOffline(Computer)}
*
* @since 1.452
*/
public void onTemporarilyOffline(Computer c, OfflineCause cause) {}
/**
* Called when configuration of the node was changed, a node is added/removed, etc.
* @since 1.377
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册