Skip to content

Commit 7ddd005

Browse files
committed
more info on NotifyingSail
Signed-off-by: Jeen Broekstra <jeen.broekstra@gmail.com>
1 parent dd7c038 commit 7ddd005

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

doc/sail/index.adoc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ The abstract base classes use the naming convention ``methodname**Internal**`` t
178178

179179
For example, the query method `AbstractSailConnection.getStatements()` provides a lot of book keeping: it ensures pending updates are flushed, acquires a read lock on the connection, verifies the connection is still open, and takes care of internally registering the resulting `Iteration` from the query for resource management and concurrency purposes. In between all of this, it calls `getStatementsInternal`. The only job of this method is to answer the query by retrieving the relevant data from the data source.
180180

181-
=== NotifyingSail and NotifyingSailConnection
181+
=== NotifyingSail and AbstractNotifyingSail
182182

183-
The `NotifyingSail` and `NotifyingSailConnection` interfaces provide basic event handling for SAIL implementations. Its main goal is to provide a messaging mechanism for closely-linked SAIL implementations (for example, a "Sail stack" where a reasoner is to be kept informed of changes to the underlying database).
183+
The `NotifyingSail` and `NotifyingSailConnection` interfaces provide basic event handling for SAIL implementations. The main goal of these interfaces is to provide a messaging mechanism for closely-linked SAIL implementations (for example, a "Sail stack" where a reasoner is to be kept informed of changes to the underlying database).
184184

185185
.NotifyingSail interfaces
186186
[[figure-notifying-sail]]
@@ -213,18 +213,28 @@ interface SailConnectionListener {
213213
+ statementRemoved(Statement st)
214214
}
215215
216+
abstract class AbstractNotifyingSail
217+
abstract class AbstractNotifyingSailConnection
216218
Sail <|-- NotifyingSail
217219
SailConnection <|-- NotifyingSailConnection
218-
NotifyingSail *-- NotifyingSailConnection
219-
NotifyingSail - SailChangedListener
220-
SailChangedListener - SailChangedEvent
221-
NotifyingSailConnection - SailConnectionListener
220+
NotifyingSail "1" *- "*" NotifyingSailConnection
221+
NotifyingSail "0..1" o-- "*" SailChangedListener
222+
SailChangedListener -d- SailChangedEvent
223+
NotifyingSailConnection "0..1" o- "*" SailConnectionListener
224+
225+
AbstractNotifyingSail -u-|> NotifyingSail
226+
AbstractNotifyingSail -u-|> AbstractSail
227+
AbstractNotifyingSailConnection -u-|> NotifyingSailConnection
228+
AbstractNotifyingSailConnection -r-|> AbstractSailConnection
222229
....
223230

224231
As can be seen in diagram <<figure-notifying-sail>>, the `NotifyingSail` interface provides the option of registering one or more `SailChangedListener` implementations. When registered, the listener will be messaged via the `sailChanged` method. The contents of the message is a `SailChangedEvent` that provides basic info on what has been changed.
225232

226233
More fine-grained event data is available at the Connection level. The `NotifyingSailConnection` allows registering a `SailConnectionListener`, which receives a message for each individual statement added or removed on the connection.
227234

235+
RDF4J also provides base implementation classes for these two interfaces. As can be seen in diagram <<figure-notifying-sail>>, these classes - `AbstractNotifyingSail` and `AbstractNotifyingSailConnection` - are extensions of the AbstractSail(Connection) classes that add
236+
default implementations of the methods defined in the NotifyingSail(Connection) interfaces.
237+
228238
=== StackableSail
229239

230240
TODO

0 commit comments

Comments
 (0)