Package sun.misc

Examples of sun.misc.Signal


         {
            shell.interrupt();
         }
      };

      Signal.handle(new Signal("INT"), interruptHandler);

   }
View Full Code Here


          exitSignalTriggered.set(true);
          existingExitHandler.get().handle(signal);
        }
      }
    };
    existingExitHandler.set(Signal.handle(new Signal("INT"), handler));
    Signal.handle(new Signal("TERM"), handler);

    try {
      main = new AgentMain(args);
    } catch (ArgumentParserException e) {
      e.printStackTrace();
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

    private BundleContext bundleContext;
    private SignalHandler previous;

    public void start(BundleContext context) throws Exception {
        bundleContext = context;
        previous = Signal.handle(new Signal(SIGNAL), this);
    }
View Full Code Here

        bundleContext = context;
        previous = Signal.handle(new Signal(SIGNAL), this);
    }

    public void stop(BundleContext context) throws Exception {
        Signal.handle(new Signal(SIGNAL), previous);
    }
View Full Code Here

    private final SignalInterceptor interceptor;

    SignalInterceptorHelper(String signame, SignalInterceptor interceptor) {
      this.interceptor = interceptor;
      Signal signal = new Signal(signame);
      oldHandler = Signal.handle(signal, this);
    }
View Full Code Here

        public void signalReceived (Number number);
    }

    public static final void register (final Number number, final Handler handler)
    {
        Signal.handle(new Signal(number.toString()), new SignalHandler() {
            public void handle (Signal sig) {
                handler.signalReceived(number);
            }
        });
    }
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.