public LuceneSpinSailConnection(NotifyingSailConnection wrappedConnection, SearchIndex luceneIndex, LuceneSpinSail sail) { super(wrappedConnection); this.luceneIndex = luceneIndex; this.sail = sail; /* * Using SailConnectionListener, see <a href="#whySailConnectionListener">above</a> */ wrappedConnection.addConnectionListener(connectionListener); }
/** * Adds the given listener to the wrapped connection. */ @Override public void addConnectionListener(SailConnectionListener listener) { getWrappedConnection().addConnectionListener(listener); }
/** * Adds the given listener to the wrapped connection. */ @Override public void addConnectionListener(SailConnectionListener listener) { getWrappedConnection().addConnectionListener(listener); }
public LuceneSailConnection(NotifyingSailConnection wrappedConnection, SearchIndex luceneIndex, LuceneSail sail) { super(wrappedConnection); this.luceneIndex = luceneIndex; this.sail = sail; if (sail.getEvaluationMode() == TupleFunctionEvaluationMode.SERVICE) { FederatedServiceResolver resolver = sail.getFederatedServiceResolver(); if (!(resolver instanceof AbstractFederatedServiceResolver)) { throw new IllegalArgumentException( "SERVICE EvaluationMode requires a FederatedServiceResolver that is an instance of " + AbstractFederatedServiceResolver.class.getName()); } this.tupleFunctionServiceResolver = (AbstractFederatedServiceResolver)resolver; } else { this.tupleFunctionServiceResolver = null; } /* * Using SailConnectionListener, see <a href="#whySailConnectionListener">above</a> */ wrappedConnection.addConnectionListener(connectionListener); }
@Override public synchronized void clear(Resource... resources) throws SailException { // remove the connection listener, this is safe as the changing methods // are synchronized // during the clear(), no other operation can be invoked getWrappedConnection().removeConnectionListener(connectionListener); try { super.clear(resources); buffer.clear(resources); } finally { getWrappedConnection().addConnectionListener(connectionListener); } }
@Override public synchronized void clear(Resource... contexts) throws SailException { // remove the connection listener, this is safe as the changing methods // are synchronized // during the clear(), no other operation can be invoked getWrappedConnection().removeConnectionListener(connectionListener); try { super.clear(contexts); buffer.clear(contexts); } finally { getWrappedConnection().addConnectionListener(connectionListener); } }