Package sun.misc

Examples of sun.misc.Signal


                        .callMethod(context, "raise", e.getException());
                } catch(Exception ignored) {}
            } catch (MainExitException mee) {
                runtime.getThreadService().getMainThread().kill();
            } finally {
                Signal.handle(new Signal(this.signal), this);
            }
        }
View Full Code Here


            handler.handle(signal.getNumber());
        }
    }
   
    public SignalHandler signal(jnr.constants.platform.Signal sig, final SignalHandler handler) {
        Signal s = new Signal(sig.name().substring("SIG".length()));
       
        sun.misc.SignalHandler oldHandler = Signal.handle(s, new SunMiscSignalHandler(handler));
       
        if (oldHandler instanceof SunMiscSignalHandler) {
            return ((SunMiscSignalHandler)oldHandler).handler;
View Full Code Here

    public ControlCSignalHandler(IClojureRepl repl) {
        this.repl = repl;
    }

    public void install() {
        Signal signal = new Signal("INT");
        Signal.handle(signal, this);
    }
View Full Code Here

    private boolean _once;
    private static SigIntHandler instance = null;
    private final Stack<Interruptable> _toInterruptStack;

    public static void install() {
        final Signal interruptSignal = new Signal("INT"); // Interrupt: Ctrl-C
        instance = new SigIntHandler();
        // don't care about the original handler.
        Signal.handle(interruptSignal, instance);
    }
View Full Code Here

    {
        this(parseConfig(configurationURL));
        _configFile = configurationURL;
        try
        {
            Signal sig = new sun.misc.Signal("HUP");
            sun.misc.Signal.handle(sig, this);
        }
        catch (IllegalArgumentException e)
        {
            // We're on something that doesn't handle SIGHUP, how sad, Windows.
View Full Code Here

    final private org.apache.commons.logging.Log LOG;
    final private SignalHandler prevHandler;

    Handler(String name, Log LOG) {
      this.LOG = LOG;
      prevHandler = Signal.handle(new Signal(name), this);
    }
View Full Code Here

    {
        this(parseConfig(configurationURL));
        _configFile = configurationURL;
        try
        {
            Signal sig = new sun.misc.Signal("HUP");
            sun.misc.Signal.handle(sig, this);
        }
        catch (Exception e)
        {
            _logger.error("Signal HUP not supported for OS: " + System.getProperty("os.name"));
View Full Code Here

   *          returning -1
   * @return 0 if ok
   */
  public int processLine(String line, boolean allowInterupting) {
    SignalHandler oldSignal = null;
    Signal interupSignal = null;

    if (allowInterupting) {
      // Remember all threads that were running at the time we started line processing.
      // Hook up the custom Ctrl+C handler while processing this line
      interupSignal = new Signal("INT");
      oldSignal = Signal.handle(interupSignal, new SignalHandler() {
        private final Thread cliThread = Thread.currentThread();
        private boolean interruptRequested;

        @Override
View Full Code Here

                Shutdown.exit(sig.getNumber() + 0200);
            }
        };
        handler = sh;
        try {
            Signal.handle(new Signal("INT"), sh);
            Signal.handle(new Signal("TERM"), sh);
        } catch (IllegalArgumentException e) {
            // When -Xrs is specified the user is responsible for
            // ensuring that shutdown hooks are run by calling
            // System.exit()
        }
View Full Code Here

  private Statement stmt = null;

  SunSignalHandler () {
    // Interpret Ctrl+C as a request to cancel the currently
    // executing query.
    Signal.handle (new Signal ("INT"), this);
  }
View Full Code Here

TOP

Related Classes of sun.misc.Signal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.