/** * @deprecated Specific to {@link Mode#REMOTING}. */ @Deprecated /*package*/ CLI(CLIConnectionFactory factory) throws IOException, InterruptedException { URL jenkins = factory.jenkins; this.httpsProxyTunnel = factory.httpsProxyTunnel; this.authorization = factory.authorization; ExecutorService exec = factory.exec; ownsPool = exec==null; pool = exec!=null ? exec : Executors.newCachedThreadPool(new NamingThreadFactory(Executors.defaultThreadFactory(), "CLI.pool")); Channel _channel; try { _channel = connectViaCliPort(jenkins, getCliTcpPort(jenkins)); } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to connect via CLI port. Falling back to HTTP", e); try { _channel = connectViaHttp(jenkins); } catch (IOException e2) { e.addSuppressed(e2); throw e; } } this.channel = _channel; // execute the command entryPoint = (CliEntryPoint)_channel.waitForRemoteProperty(CliEntryPoint.class.getName()); if(entryPoint.protocolVersion()!=CliEntryPoint.VERSION) throw new IOException(Messages.CLI_VersionMismatch()); }
if(entryPoint.protocolVersion()!=CliEntryPoint.VERSION) throw new IOException(Messages.CLI_VersionMismatch());