Class Signals
java.lang.Object
org.aesh.terminal.tty.utils.Signals
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinvokeHandler(String name, Object handler) Invokes a signal handler directly for the specified signal.static ObjectRegisters a signal handler for the specified signal.static Objectregister(String name, Runnable handler, ClassLoader loader) Registers a signal handler using the specified class loader.static ObjectregisterDefault(String name) Registers the default signal handler for the specified signal.static ObjectregisterIgnore(String name) Registers an ignore handler for the specified signal, causing the signal to be ignored.static voidunregister(String name, Object previous) Unregisters a signal handler by restoring the previous handler.
-
Method Details
-
register
Registers a signal handler for the specified signal.- Parameters:
name- the signal, CONT, STOP, etc...handler- the callback to run- Returns:
- an object that needs to be passed to the
unregister(String, Object)method to unregister the handler
-
register
Registers a signal handler using the specified class loader.- Parameters:
name- the signal name (e.g., CONT, STOP)handler- the callback to run when the signal is receivedloader- the class loader to use for creating the signal handler proxy- Returns:
- an object that needs to be passed to
unregister(String, Object)to unregister the handler, or null if registration failed
-
registerDefault
Registers the default signal handler for the specified signal.- Parameters:
name- the signal name (e.g., CONT, STOP)- Returns:
- an object that needs to be passed to
unregister(String, Object)to unregister the handler, or null if registration failed
-
registerIgnore
Registers an ignore handler for the specified signal, causing the signal to be ignored.- Parameters:
name- the signal name (e.g., CONT, STOP)- Returns:
- an object that needs to be passed to
unregister(String, Object)to unregister the handler, or null if registration failed
-
invokeHandler
-
unregister
-