-
Notifications
You must be signed in to change notification settings - Fork 28
SJDGMonitor
The monitoring capability is used to ensure that a system conforms to a protocol description at runtime. This is a form of dynamic validation, or conformance checking.
To efficiently monitor a running system, to ensure that it is conformed to one or more roles within a protocol description, it is necessary to transform the text based description (and even the object model representation) into a form that can more effectively be used to drive a runtime monitoring solution.
org.scribble.context.ModuleLoader loader=...; org.scribble.resources.Resource res=...; org.scribble.model.local.LProtocolDefinition lp=...; // Obtain the required local protocol definition org.scribble.monitor.export.MonitorExporter exporter=new org.scribble.monitor.export.MonitorExporter(); org.scribble.context.ModuleContext context=new org.scribble.context.DefaultModuleContext(res, lp.getModule(), loader); org.scribble.monitor.model.SessionType type=exporter.export(context, lp);
The first step is to obtain the module that contains the local protocol definition to be monitored. This can ether be achieved by parsing a textual representation of a local protocol definition, or by projecting the local modules from a global module.
Once the module is obtained, then the specific local protocol definition can be retrieved. As a module may contain multiple local protocol definitions, it is important to select the one that represents the initial (or top level) protocol definition from the perspective of what needs to be monitored.
Once the exporter has been instantiated, invoke the export method with the selected local protocol definition. This will export the protocol definition into a state machine representation associated with the returned org.scribble.monitor.model.SessionType object. This object will be used in subsequent runtime monitoring session instances to define the behavioural type being verified.