use of org.exist.storage.UpdateListener in project exist by eXist-db.
the class LocationStep method registerUpdateListener.
/**
* Register the update listener
*/
protected void registerUpdateListener() {
if (listener == null) {
listener = new UpdateListener() {
@Override
public void documentUpdated(final DocumentImpl document, final int event) {
cached = null;
if (document == null || event == UpdateListener.ADD || event == UpdateListener.REMOVE) {
// clear all
currentDocs = null;
currentSet = null;
} else {
if (currentDocs != null && currentDocs.contains(document.getDocId())) {
currentDocs = null;
currentSet = null;
}
}
}
@Override
public void nodeMoved(final NodeId oldNodeId, final NodeHandle newNode) {
// no-op
}
@Override
public void unsubscribe() {
LocationStep.this.listener = null;
}
@Override
public void debug() {
if (LOG.isDebugEnabled()) {
LOG.debug("UpdateListener: Line: {}; id: {}", LocationStep.this.toString(), LocationStep.this.getExpressionId());
}
}
};
context.registerUpdateListener(listener);
}
}
use of org.exist.storage.UpdateListener in project exist by eXist-db.
the class FunDoc method registerUpdateListener.
protected void registerUpdateListener() {
if (listener == null) {
listener = new UpdateListener() {
@Override
public void documentUpdated(DocumentImpl document, int event) {
// clear all
}
@Override
public void unsubscribe() {
FunDoc.this.listener = null;
}
public void nodeMoved(NodeId oldNodeId, NodeHandle newNode) {
// not relevant
}
@Override
public void debug() {
logger.debug("UpdateListener: Line: {}: {}", getLine(), FunDoc.this.toString());
}
};
context.registerUpdateListener(listener);
}
}
use of org.exist.storage.UpdateListener in project exist by eXist-db.
the class ExtCollection method registerUpdateListener.
protected void registerUpdateListener() {
if (listener == null) {
listener = new UpdateListener() {
@Override
public void documentUpdated(final DocumentImpl document, final int event) {
// Nothing to do (previously was cache management)
}
@Override
public void unsubscribe() {
ExtCollection.this.listener = null;
}
@Override
public void nodeMoved(final NodeId oldNodeId, final NodeHandle newNode) {
// not relevant
}
@Override
public void debug() {
if (LOG.isDebugEnabled()) {
LOG.debug("UpdateListener: Line: {}: {}", getLine(), ExtCollection.this.toString());
}
}
};
context.registerUpdateListener(listener);
}
}
use of org.exist.storage.UpdateListener in project exist by eXist-db.
the class RootNode method registerUpdateListener.
protected void registerUpdateListener() {
if (listener == null) {
listener = new UpdateListener() {
@Override
public void documentUpdated(DocumentImpl document, int event) {
// clear all
cachedDocs = null;
cached = null;
}
@Override
public void unsubscribe() {
RootNode.this.listener = null;
}
@Override
public void nodeMoved(NodeId oldNodeId, NodeHandle newNode) {
// not relevant
}
@Override
public void debug() {
LOG.debug("UpdateListener: Line: {}", RootNode.this.toString());
}
};
context.registerUpdateListener(listener);
}
}
Aggregations