Search in sources :

Example 11 with Signal

use of sun.misc.Signal in project orientdb by orientechnologies.

the class OSignalHandler method listenTo.

public void listenTo(final String name, final SignalHandler iListener) {
    Signal signal = new Signal(name);
    SignalHandler redefinedHandler = Signal.handle(signal, iListener);
    if (redefinedHandler != null) {
        redefinedHandlers.put(signal, redefinedHandler);
    }
}
Also used : Signal(sun.misc.Signal) SignalHandler(sun.misc.SignalHandler)

Example 12 with Signal

use of sun.misc.Signal in project jdk8u_jdk by JetBrains.

the class Terminator method setup.

/* Invocations of setup and teardown are already synchronized
     * on the shutdown lock, so no further synchronization is needed here
     */
static void setup() {
    if (handler != null)
        return;
    SignalHandler sh = new SignalHandler() {

        public void handle(Signal sig) {
            Shutdown.exit(sig.getNumber() + 0200);
        }
    };
    handler = sh;
    // System.exit()
    try {
        Signal.handle(new Signal("INT"), sh);
    } catch (IllegalArgumentException e) {
    }
    try {
        Signal.handle(new Signal("TERM"), sh);
    } catch (IllegalArgumentException e) {
    }
}
Also used : Signal(sun.misc.Signal) SignalHandler(sun.misc.SignalHandler)

Aggregations

Signal (sun.misc.Signal)12 SignalHandler (sun.misc.SignalHandler)9 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 DTConfiguration (com.datatorrent.stram.client.DTConfiguration)1 LogicalPlanConfiguration (com.datatorrent.stram.plan.logical.LogicalPlanConfiguration)1 TestSuiteModel (com.google.testing.junit.runner.model.TestSuiteModel)1 TTYConsoleReader (com.orientechnologies.common.console.TTYConsoleReader)1 OSystemException (com.orientechnologies.common.exception.OSystemException)1 OIOException (com.orientechnologies.common.io.OIOException)1 OSignalHandler (com.orientechnologies.orient.core.OSignalHandler)1 OConfigurationException (com.orientechnologies.orient.core.exception.OConfigurationException)1 ODatabaseException (com.orientechnologies.orient.core.exception.ODatabaseException)1 ORetryQueryException (com.orientechnologies.orient.core.exception.ORetryQueryException)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStream (java.io.OutputStream)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 ArgumentParserException (net.sourceforge.argparse4j.inf.ArgumentParserException)1 BasicParser (org.apache.commons.cli.BasicParser)1 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1