org.openmi.standard
Interface IEvent


public interface IEvent

Within modern software systems, events are often applied for all types of messaging. Within OpenMI a lightweight event mechanism is applied, using a generic Event interface and an enumeration of event types (OpenMI.Standard.EventType) to allow the implementation of generic tools that perform monitoring tasks such as logging, tracing, or online visualization. Linkable components must generate events to which other linkable components or tools can subscribe. In this way, it becomes possible to implement these generic tools without requiring any knowledge of the specific tools in the components themselves. By adopting the OpenMI event types, system developers can use those tools without additional effort. Note that the event mechanism should not be used to pass data sets. Data sets should be retrieved through the GetValues() call. The event mechanism is also used to facilitate pausing and resuming of the computation thread, as the computation process of an entire model chain is rather autonomous and not controlled by any master controller. Once a component receives the thread, it must send an event, so listeners (e.g. a GUI) can grab and hold the thread, and thus pause the computation by not returning control. In normal conditions, the control is returned so the component can continue its computation. Of course the computation is also controlled at the level that triggers the first component of the chain by means of a GetValues()-call. Stop firing those calls will also result in a paused system, although it may take a while before an entire call stack completes its processing activity.


Nested Class Summary
static class IEvent.EventType
          Enumeration for event types.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
          Get the value of a Key=Value pair, containing additional information on the event.
 java.lang.String getDescription()
          Additional descriptive information
 ILinkableComponent getSender()
          ILinkableComponent that generated the event.
 ITimeStamp getSimulationTime()
          Current SimulationTime ("-" if not applicable)
 IEvent.EventType getType()
          Type of event
 

Method Detail

getType

IEvent.EventType getType()
Type of event


getDescription

java.lang.String getDescription()
Additional descriptive information


getSender

ILinkableComponent getSender()
ILinkableComponent that generated the event.


getSimulationTime

ITimeStamp getSimulationTime()
Current SimulationTime ("-" if not applicable)


getAttribute

java.lang.Object getAttribute(java.lang.String key)
Get the value of a Key=Value pair, containing additional information on the event. This method must throw an exception if the key is not recognized.