4.1 The Signal Event API

Signal events are manipulated within the Reaction framework using signal event objects. The reactor core acts as a factory for these objects and the standard reactor interface (Reactor) provides the API shown in Listing 4.1.


\begin{listing}
% latex2html id marker 841\begin{small}\begin{verbatim}packa...
...\end{verbatim} \end{small}\caption{Reactor Signal Factory Methods}
\end{listing}

The signal factory methods will return an object which implements the Signal interface as shown in Listing 4.2. Such objects are referred to here as being signal event objects since they encapsulate all the state associated with a single signal. The Signal interface provides methods for subscribing and unsubscribing signalable objects (ie, those implementing Signalable) and for generating new signal events notifications.


\begin{listing}
% latex2html id marker 854\begin{small}\begin{verbatim}packa...
...d{verbatim} \end{small}\caption{Signal Event Interface Definition}
\end{listing}


\begin{listing}
% latex2html id marker 862\begin{small}\begin{verbatim}packa...
...verbatim} \end{small}\caption{The Signalable Interface Definition}
\end{listing}