Package sun.misc

Examples of sun.misc.Signal


        SignalHandler handler = new SignalHandler () {
            public void handle(Signal sig) {
                Settings.getInstance().getInterruptHook().handleInterrupt(console);
            }
        };
        Signal.handle(new Signal("INT"), handler);
    }
View Full Code Here


import java.util.concurrent.Callable;

class SignalInterceptorHelper {

    static void register(String signame, Callable fn) {
        Signal sig = new Signal(signame);
        WrappedCallable newHandler = new WrappedCallable(fn);
        SignalHandler oldHandler = Signal.handle(sig, newHandler);
        newHandler.attachOld(oldHandler);
    }
View Full Code Here

        SignalHandler handler = new SignalHandler () {
            public void handle(Signal sig) {
                Settings.getInstance().getInterruptHook().handleInterrupt(console);
            }
        };
        Signal.handle(new Signal("INT"), handler);
    }
View Full Code Here

        log.info(HORIZONTAL_RULE);
        log.info(" Command Line Configuration");
        log.info(HORIZONTAL_RULE);
        log.info(config.getConfigDumpString());

        Signal.handle(new Signal("TERM"), new SignalHandler() {
            public void handle(Signal sig) {

                log.error("Received SIGTERM signal. Will teardown.");
                // stop run, it will clean up
                runBenchmark = false;
                timer.cancel();
                benchmarkThread.interrupt();
            }
        });
        Signal.handle(new Signal("INT"), new SignalHandler() {
            public void handle(Signal sig) {

                log.error("Received SIGINT signal. Will teardown.");
                // stop run, it will clean up
                runBenchmark = false;
View Full Code Here

    }
    NSMutableArray<SignalHandler> listeners = _handler.signals.objectForKey(signalName);
    if(listeners == null) {
      listeners = new NSMutableArray<SignalHandler>();
     
          Signal signal = new Signal(signalName);
          Signal.handle(signal, _handler);
          _handler.signals.setObjectForKey(listeners, signalName);
    }
    listeners.addObject(handler);
  }
View Full Code Here

            // Just the rgular termination request
            NSArray signals = ERXProperties.arrayForKey("er.extensions.ERXGracefulShutdown.SignalsToHandle");
            if (signals != null && signals.count() > 0) {
                for (Enumeration signalsEnumerator = signals.objectEnumerator();
                     signalsEnumerator.hasMoreElements();) {
                    Signal signal = new Signal((String)signalsEnumerator.nextElement());
                    ERXGracefulShutdown handler = new ERXGracefulShutdown();
                    handler.setDefaultHandler(Signal.handle(signal, handler));
                }
            }
        }
View Full Code Here

            }
            catch (IOException | InterruptedException ignored) {
            }
        }
        else {
            int signal = new Signal(graceful ? "TERM" : "KILL").getNumber();
            posix.kill(pid, signal);
        }
    }
View Full Code Here

                System.exit(-1);
            }
        }

        // when we are killed, kill all the worker processes, too.
        Signal.handle(new Signal("TERM"),
            new SignalHandler() {
                public void handle(Signal sig) {
                    LIBC.kill(0,SIGTERM);
                    System.exit(-1);
                }
View Full Code Here

    //注册信号 linux下支持USR2
    logger.info("------------------signal registr start---------------------");
    String osName = System.getProperty("os.name").toLowerCase();
    if(osName != null && osName.indexOf("window") == -1){
      OperateSignal operateSignalHandler = new OperateSignal();
      Signal sig = new Signal("USR2");
      Signal.handle(sig, operateSignalHandler);
    }
    logger.info("------------------signal registr success----------------------\n");
   
    // load servers
View Full Code Here

             public void handle(Signal sig) {
                 LOGGER.info("Got Signal: "+sig);
                 //console.get
             }
         };
         original = Signal.handle(new Signal("CONT"), handler);
     }
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.