@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) { SlaveComputer slaveComputer = null; if (c instanceof SlaveComputer) { slaveComputer = (SlaveComputer) c; } install(channel, slaveComputer); }
@Override public Void call() throws IOException { // No sense in setting up channel pinger if the channel is being closed setUpPingForChannel(getOpenChannelOrFail(), null, pingTimeoutSeconds, pingIntervalSeconds, false); return null; }
@VisibleForTesting /*package*/ void install(Channel channel, @CheckForNull SlaveComputer c) { if (pingTimeoutSeconds < 1 || pingIntervalSeconds < 1) { LOGGER.warning("Agent ping is disabled"); return; } // set up ping from both directions, so that in case of a router dropping a connection, // both sides can notice it and take compensation actions. try { channel.call(new SetUpRemotePing(pingTimeoutSeconds, pingIntervalSeconds)); LOGGER.fine("Set up a remote ping for " + channel.getName()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to set up a ping for " + channel.getName(), e); } setUpPingForChannel(channel, c, pingTimeoutSeconds, pingIntervalSeconds, true); }
public void install(Channel channel) { install(channel, null); }
@Override public Void call() throws IOException { setUpPingForChannel(Channel.current(), null, pingTimeoutSeconds, pingIntervalSeconds, false); return null; }
public void install(Channel channel) { install(channel, null); }
@VisibleForTesting /*package*/ void install(Channel channel, @CheckForNull SlaveComputer c) { if (pingTimeoutSeconds < 1 || pingIntervalSeconds < 1) { LOGGER.warning("Agent ping is disabled"); return; } // set up ping from both directions, so that in case of a router dropping a connection, // both sides can notice it and take compensation actions. try { channel.call(new SetUpRemotePing(pingTimeoutSeconds, pingIntervalSeconds)); LOGGER.fine("Set up a remote ping for " + channel.getName()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to set up a ping for " + channel.getName(), e); } setUpPingForChannel(channel, c, pingTimeoutSeconds, pingIntervalSeconds, true); }
@Override public void preOnline(Computer c, Channel channel, FilePath root, TaskListener listener) { SlaveComputer slaveComputer = null; if (c instanceof SlaveComputer) { slaveComputer = (SlaveComputer) c; } install(channel, slaveComputer); }