public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; final StreamSet streams = StreamSet.system(); final SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { final groovy.ui.Console console = new groovy.ui.Console(classLoader, new Binding()) { public void exit(final EventObject event) { try { super.exit(event); } finally { synchronized (lock) { lock.notifyAll(); } } } }; console.run(); synchronized (lock) { lock.wait(); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } } }
public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; final StreamSet streams = StreamSet.system(); final SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { final groovy.ui.Console console = new groovy.ui.Console(classLoader, new Binding()) { public void exit(final EventObject event) { try { super.exit(event); } finally { synchronized (lock) { lock.notifyAll(); } } } }; console.run(); synchronized (lock) { lock.wait(); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } } }
System.setSecurityManager(new NoExitSecurityManager());
System.setSecurityManager(new NoExitSecurityManager());
public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; boolean legacy = config().get(LEGACY, false); final StreamSet streams = StreamSet.system(); // Put a nice blank before and after we run the shell streams.out.println(); SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { if (!legacy) { new DefaultTask(config()).run(classLoader); } else { new LegacyTask().run(classLoader); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } // The blank after streams.out.println(); } }
public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; boolean legacy = config().get(LEGACY, false); final StreamSet streams = StreamSet.system(); // Put a nice blank before and after we run the shell streams.out.println(); SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { if (!legacy) { new DefaultTask(config()).run(classLoader); } else { new LegacyTask().run(classLoader); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } // The blank after streams.out.println(); } }
public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; boolean legacy = config().get(LEGACY, false); final StreamSet streams = StreamSet.system(); // Put a nice blank before and after we run the shell streams.out.println(); SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { if (!legacy) { new DefaultTask(config()).run(classLoader); } else { new LegacyTask().run(classLoader); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } // The blank after streams.out.println(); } }
public void execute(final ClassLoader classLoader) throws Exception { assert classLoader != null; boolean legacy = config().get(LEGACY, false); final StreamSet streams = StreamSet.system(); // Put a nice blank before and after we run the shell streams.out.println(); SecurityManager sm = System.getSecurityManager(); System.setSecurityManager(new NoExitSecurityManager()); try { if (!legacy) { new DefaultTask(config()).run(classLoader); } else { log.warn("Legacy task not supported in 2.0. Using default task."); new DefaultTask(config()).run(classLoader); } } finally { System.setSecurityManager(sm); StreamSet.system(streams); } // The blank after streams.out.println(); } }