The purpose of the InfoGrid Probe Framework is to make the content of external data sources appear as native InfoGrid objects that self-update, shadowing the content of the external data source as it changes. By doing this, the development of applications that use changing data from external sources (like RSS feeds, web service calls, ...) becomes substantially simpler.
It accomplishes this through the following concepts:
- one or more ShadowMeshBases, each of which contains the content of one external data source, as a set of related MeshObjects.
- one or more Probes, which know how to convert the content of the external data source into the set of related MeshObjects
- a ProbeDirectory, which initially defines which Probe class should be run for a given data source
- a StagingMeshBase, which contains the MeshObjects reflecting the most recent update of the data source
- a Differencer, which determines the difference in the MeshObjectGraphs in the ShadowMeshBase (i.e. the previous content of the data source) and the StagingMeshBase (i.e. the most recent content).
- an algorithm that determines when to run an update.
Often, applications choose to update a ShadowMeshBase periodically. (The actual timing depends on the applied policy, which can be defined and updated programmatically.) During each update, the following sequence of events occurs:
- The correct Probe is determined for the given data source, by means of the ProbeDirectory, any preferences that the data source expressed in a previous run, and the MIME type and URL of the data source
- Changes made by the InfoGrid application to MeshObjects instantiated from the data source content are passed to the Probe, which can attempt to update the data source accordingly. This only occurs if the Probe is a WritableProbe.
- The Probe re-reads the data source, and instantiates the corresponding MeshObjects into the StagingMeshBase.
- The Differencer compares the previously-read set of MeshObjects (current content of the ShadowMeshBase) with the most recently-read set of MeshObjects (current content of the StagingMeshBase)
- It then applies the found changes to the ShadowMeshBase, which transitions the MeshObjectGraph contained in the ShadowMeshBase to the most current version.
- The StagingMeshBase is discarded.
- As a consequence, the ShadowMeshBase emits a stream of events that is identical to the stream of events that would have been emitted if the ShadowMeshBase's MeshObjects would have been manipulated there directly. If conveyed via XPRISO, other MeshBases cannot distinguish this event stream from any other event stream conveyed via XPRISO.
- A future update may be scheduled.