public final class Signal extends AsyncEvent implements ActiveEvent<Signal,SignalDispatcher>
ActiveEvent subclass for defining a POSIX signal.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUM_SIGNALS
Obtains the number of signals that can be processed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(AsyncBaseEventHandler handler)
Add a handler to the set of handlers associated with
this event.
|
void |
disable()
Change the state of the event so that the associated handlers
are skipped on fire.
|
void |
enable()
Change the state of the event so that associated handlers
are released on fire.
|
static Signal |
get(int id)
Gets a supported signal by its ID.
|
static Signal |
get(java.lang.String name)
Gets a supported signal by its name.
|
SignalDispatcher |
getDispatcher()
Obtains the dispatcher for
this. |
int |
getId()
Gets the number of this signal.
|
static int |
getId(java.lang.String name)
Gets the ID of a supported signal by its name.
|
java.lang.String |
getName()
Gets the name of this signal.
|
static long |
getProcessId()
Obtains the OS Id of the JVM process.
|
boolean |
isActive()
Determines the activation state of this signal,
i.e., whether or not it has been started.
|
static boolean |
isPOSIXSignal(java.lang.String name)
Determines if a signal with a given name is registered.
|
boolean |
isRunning()
Determines the firing state, releasing or skipping, of this signal,
i.e., whether or not it is active and enabled.
|
void |
removeHandler(AsyncBaseEventHandler handler)
Remove a handler from the set associated with this event.
|
void |
send(long pid)
Sends this signal to another process or process group.
|
void |
setHandler(AsyncBaseEventHandler handler)
Associate a new handler with this event and remove all
existing handlers.
|
void |
start()
Starts this
Signal, i.e., changes to a running state. |
void |
start(boolean disabled)
Starts this
Signal, i.e., changes to a running state. |
boolean |
stop()
Stops this
Signal. |
addHandler, bindTo, createReleaseParameters, fire, handledBy, removeHandler, setHandler, unbindTohandledBy, hasHandlerspublic static final int MAX_NUM_SIGNALS
public static boolean isPOSIXSignal(java.lang.String name)
name - The string passed as the name of the signal.true when a signal with the given name is registered.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public static int getId(java.lang.String name)
name - The name of the signal for which to search.name.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public static Signal get(java.lang.String name)
name - The name identifying the signal to get.name or null.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public static Signal get(int id)
id - The identifier of a registered signal.ID or null.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public static long getProcessId()
send(long).ID.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public int getId()
java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public java.lang.String getName()
java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public SignalDispatcher getDispatcher()
this.getDispatcher in interface Releasable<Signal,SignalDispatcher>java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public boolean isActive()
isActive in interface ActiveEvent<Signal,SignalDispatcher>true when active; false otherwise.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public boolean isRunning()
isRunning in interface ActiveEvent<Signal,SignalDispatcher>isRunning in class AsyncBaseEventtrue when releasing, false when skipping.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void start()
throws StaticIllegalStateException
Signal, i.e., changes to a running state.
A running signal is a source of activation when in a scoped memory
and is a member of the root set when in the heap. A running
signal can be triggered.start in interface ActiveEvent<Signal,SignalDispatcher>StaticIllegalStateException - when this
Signal has already been started.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.stop()public void start(boolean disabled)
throws StaticIllegalStateException
Signal, i.e., changes to a running state.
A running signal is a source of activation when in a scoped memory
and is a member of the root set when in the heap. A running
signal can be triggered.start in interface ActiveEvent<Signal,SignalDispatcher>disabled - true for starting in a disabled state.StaticIllegalStateException - when this
Signal has already been started.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.stop()public boolean stop()
throws StaticIllegalStateException
Signal. A stopped signal
ceases to be a source of activation and no longer causes any AE attached
to it to be a source of activation.stop in interface ActiveEvent<Signal,SignalDispatcher>true when this was enabled and
false otherwise.StaticIllegalStateException - when this
Signal is not running.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void send(long pid)
throws POSIXInvalidSignalException,
POSIXSignalPermissionException,
POSIXInvalidTargetException
On POSIX systems running in user space, the following holds:
POSIX.1-2001 requires the underlying mechanism of signal.send(-1)
to send signal to all processes for which the current process may
signal, except possibly for some OS-defined system processes.
For an RTVM running in kernel space, the meaning of the pid
is implementation dependent, though it should be as closed to the standard
definition as possible.
pid - ID of the process to which to send the signal.POSIXInvalidSignalException - when the signal number is not valid.POSIXSignalPermissionException - when the process does not have permission to send the target.POSIXInvalidTargetException - when the target does not exist.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void addHandler(AsyncBaseEventHandler handler)
addHandler in class AsyncBaseEventhandler - The new handler to add to the list of
handlers already associated with this.
When handler is already associated with
the event, the call has no effectjava.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void setHandler(AsyncBaseEventHandler handler)
setHandler in class AsyncBaseEventhandler - The instance of AsyncBaseEventHandler to
be associated with this. When handler is
null then no handler will be associated
with this, i.e., behave effectively as if
setHandler(null) invokes
removeHandler(AsyncBaseEventHandler) for
each associated handler.java.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void removeHandler(AsyncBaseEventHandler handler)
removeHandler in class AsyncBaseEventhandler - The handler to be disassociated from this. When
null nothing happens. When the handler is not
already associated with this then nothing happensjava.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void enable()
enable in interface ActiveEvent<Signal,SignalDispatcher>enable in class AsyncBaseEventjava.lang.UnsupportedOperationException - everytime, since this is not implemented yet.public void disable()
disable in interface ActiveEvent<Signal,SignalDispatcher>disable in class AsyncBaseEventjava.lang.UnsupportedOperationException - everytime, since this is not implemented yet.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2021 aicas GmbH. All Rights Reserved.