Note that ModeShape will correctly generate events for all changes to the external system initiated by ModeShape, and therefore the connector should not record any such changes. However, if the external system undergoes changes due to non-ModeShape activities, such changes can/should be captured by the connector so that ModeShape and its clients are notified of these changes. Therefore, the recording of changes will likely be through an asynchronous activity.
When an external system undergoes some independent changes, the connector can {@link Connector#newConnectorChangedSet() obtain}a new change set, call methods on the change set to record events of interest in the property order, and then {@link #publish(Map)} all of the changes that have been recorded. Only when a change set is {@link #publish(Map) published}will the repository be notified of the recorded changes and forward them to its appropriate listeners.
Connectors may expose a single document at multiple paths. In such cases the Connector will likely generate events for only one of those paths (i.e., the "primary" path, whatever the Connector chooses to use). However, Connectors may choose to generate mutliple events for single resources available at multiple paths.
It is safe to only call methods on a {@link ConnectorChangeSet} instance from a single thread. If a connector uses multiplethreads to record changes, the connector should either use separate ConnectorChangeSet instances for each thread or (if the changes from multiple threads are to be recorded as a single atomic set) ensure that it calls the methods in a synchronized fashion.
@author ajs6f @author rhauch@redhat.com @see Connector#newConnectorChangedSet()
|
|
|
|
|
|