Package org.apache.jena.graph
Interface GraphEventManager
- All Superinterfaces:
GraphListener
- All Known Implementing Classes:
SimpleEventManager
The component of a graph responsible for managing events and listeners.
The interface extends GraphListener because most of the notifications are
the same; the special case to note is that an event manager expects to be
handed iterator events as lists, not as iterators.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Answer true iff there is at least one attached listener.void
notifyAddIterator
(Graph g, List<Triple> triples) Notify all attached listeners that an iterator [of triples] has been added to the graph; its content has been captured in the listtriples
.void
notifyDeleteIterator
(Graph g, List<Triple> triples) Notify all attached listeners that an iterator [of triples] has been removed from the graph; its content has been captured in the listtriples
.register
(GraphListener listener) Attachedlistener
to this manager; notification events sent to the manager are sent to all registered listeners.unregister
(GraphListener listener) Iflistener
is attached to this manager, detach it, otherwise do nothing.Methods inherited from interface org.apache.jena.graph.GraphListener
notifyAddArray, notifyAddGraph, notifyAddIterator, notifyAddList, notifyAddTriple, notifyDeleteArray, notifyDeleteGraph, notifyDeleteIterator, notifyDeleteList, notifyDeleteTriple, notifyEvent
-
Method Details
-
register
Attachedlistener
to this manager; notification events sent to the manager are sent to all registered listeners. A listener may be registered multiple times, in which case it's called multiple times per event. A listener will be notified of an event if it is registered before the Graph method call that initiated the event, and was not unregistered before that method call returned. In addition, a listener may (or may not) be notified of an event if it is registered before such a method returns or is unregistered after such a method is called. For example, it may unregister itself in response to the event. If the registration and/or unregistration occur on different threads the usual thread uncertainties in such statements apply.- Parameters:
listener
- a listener to be fed events- Returns:
- this manager, for cascading
-
unregister
Iflistener
is attached to this manager, detach it, otherwise do nothing. Only a single registration is removed.- Parameters:
listener
- the listener to be detached from the graph- Returns:
- this manager, for cascading
-
listening
boolean listening()Answer true iff there is at least one attached listener.- Returns:
- true iff there is at least one attached listener
-
notifyAddIterator
Notify all attached listeners that an iterator [of triples] has been added to the graph; its content has been captured in the listtriples
. -
notifyDeleteIterator
Notify all attached listeners that an iterator [of triples] has been removed from the graph; its content has been captured in the listtriples
.
-