/** * Registers this {@link ComputerListener} so that it will start receiving events. * * @deprecated as of 1.286 * put {@link Extension} on your class to have it auto-registered. */ @Deprecated public final void register() { all().add(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive further events. * * <p> * Unless {@link ComputerListener} is unregistered, it will never be a subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * If still connected, disconnect. */ private void closeChannel() { // TODO: race condition between this and the setChannel method. Channel c; synchronized (channelLock) { c = channel; channel = null; absoluteRemoteFs = null; isUnix = null; } if (c != null) { try { c.close(); } catch (IOException e) { logger.log(Level.SEVERE, "Failed to terminate channel to " + getDisplayName(), e); } for (ComputerListener cl : ComputerListener.all()) cl.onOffline(this, offlineCause); } }
@Override public void onRestart() { Computer computer = Jenkins.getInstance().toComputer(); if (computer == null) return; RestartCause cause = new RestartCause(); for (ComputerListener listener: ComputerListener.all()) { listener.onOffline(computer, cause); } }
/** * Marks the computer as temporarily offline. This retains the underlying * {@link Channel} connection, but prevent builds from executing. * * @param cause * If the first argument is true, specify the reason why the node is being put * offline. */ public void setTemporarilyOffline(boolean temporarilyOffline, OfflineCause cause) { offlineCause = temporarilyOffline ? cause : null; this.temporarilyOffline = temporarilyOffline; Node node = getNode(); if (node != null) { node.setTemporaryOfflineCause(offlineCause); } synchronized (statusChangeLock) { statusChangeLock.notifyAll(); } for (ComputerListener cl : ComputerListener.all()) { if (temporarilyOffline) cl.onTemporarilyOffline(this,cause); else cl.onTemporarilyOnline(this); } }
for (ComputerListener cl : ComputerListener.all()) { try { cl.onConfigurationChange();
for (ComputerListener cl : ComputerListener.all()) { try { cl.onOnline(c, new LogTaskListener(LOGGER, INFO));
/** * Registers this {@link ComputerListener} so that it will start receiving events. * * @deprecated as of 1.286 * put {@link Extension} on your class to have it auto-registered. */ public final void register() { all().add(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive * further events. * * <p> Unless {@link ComputerListener} is unregistered, it will never be a * subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * Registers this {@link ComputerListener} so that it will start receiving events. * * @deprecated as of 1.286 * put {@link Extension} on your class to have it auto-registered. */ public final void register() { all().add(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive further events. * * <p> * Unless {@link ComputerListener} is unregistered, it will never be a subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * Registers this {@link ComputerListener} so that it will start receiving events. * * @deprecated as of 1.286 * put {@link Extension} on your class to have it auto-registered. */ @Deprecated public final void register() { all().add(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive further events. * * <p> * Unless {@link ComputerListener} is unregistered, it will never be a subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive further events. * * <p> * Unless {@link ComputerListener} is unregistered, it will never be a subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * Registers this {@link ComputerListener} so that it will start receiving * events. * * @deprecated as of 1.286 put {@link Extension} on your class to have it * auto-registered. */ public final void register() { all().add(this); }
/** * Registers this {@link ComputerListener} so that it will start receiving events. * * @deprecated as of 1.286 * put {@link Extension} on your class to have it auto-registered. */ public final void register() { all().add(this); }
/** * Unregisters this {@link ComputerListener} so that it will never receive further events. * * <p> * Unless {@link ComputerListener} is unregistered, it will never be a subject of GC. */ public final boolean unregister() { return all().remove(this); }
/** * If still connected, disconnect. */ private void closeChannel() { // TODO: race condition between this and the setChannel method. Channel c = channel; channel = null; isUnix = null; if (c != null) { try { c.close(); } catch (IOException e) { logger.log(Level.SEVERE, "Failed to terminate channel to " + getDisplayName(), e); } } for (ComputerListener cl : ComputerListener.all()) cl.onOffline(this); }
@Override public void onRestart() { Computer computer = Jenkins.getInstance().toComputer(); if (computer == null) return; RestartCause cause = new RestartCause(); for (ComputerListener listener: ComputerListener.all()) { listener.onOffline(computer, cause); } }