public int main(List<String> args, Locale locale, InputStream stdin, OutputStream stdout, OutputStream stderr) { // remoting sets the context classloader to the RemoteClassLoader, // which slows down the classloading. we don't load anything from CLI, // so counter that effect. Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); PrintStream out = new PrintStream(stdout); PrintStream err = new PrintStream(stderr); String subCmd = args.get(0); CLICommand cmd = CLICommand.clone(subCmd); if(cmd!=null) { cmd.channel = Channel.current(); final CLICommand old = CLICommand.setCurrent(cmd); try { transportAuth = Channel.currentOrFail().getProperty(CLICommand.TRANSPORT_AUTHENTICATION); cmd.setTransportAuth(transportAuth); return cmd.main(args.subList(1,args.size()),locale, stdin, out, err); } finally { CLICommand.setCurrent(old); } } err.println("No such command: "+subCmd); new HelpCommand().main(Collections.emptyList(), locale, stdin, out, err); return -1; }
public Void call() throws RuntimeException { Channel.currentOrFail().maximumBytecodeLevel = level; return null; }
@Override public Object call() throws InterruptedException { Channel.currentOrFail().syncLocalIO(); return null; }
public ISaturationTest call() throws IOException { return Channel.currentOrFail().export(ISaturationTest.class, new ISaturationTest() { private InputStream in; public void ensureConnected() throws IOException { in = pipe.getIn(); } public int readFirst() throws IOException { return in.read(); } public void readRest() throws IOException { new DataInputStream(in).readFully(new byte[Channel.PIPE_WINDOW_SIZE*2]); } }); } }
public Void call() throws IOException { Channel.currentOrFail().setJarCache(new FileSystemJarCache(dir, true)); return null; } }
public String call() throws Exception { return Channel.currentOrFail().call(new GunImporter()); } }
if(goingHome) return Channel.currentOrFail().getExportedObject(oid); else return proxy;
public Void call() throws IOException { try { final Channel ch = Channel.currentOrFail(); final JarCache jarCache = ch.getJarCache(); if (jarCache == null) { throw new IOException("Cannot Force JAR load, JAR cache is disabled"); } jarCache.resolve(ch,sum1,sum2).get(); return null; } catch (InterruptedException e) { throw new IOException(e); } catch (ExecutionException e) { throw new IOException(e); } } }