Class LockableOntModel
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableOntModel
-
public class LockableOntModel extends Object
Makes it easy to use a Jena OntModel in a try-with-resources block. At the end of the block, the close() method will not close the model, but will merely release the lock. Returned by the LockableOntModelSelector, or it can be wrapped around a bare OntModel. Cannot be used without locking.try (LockedOntModel m = lockableOms.getDisplayModel.read()) { ... }ortry (LockedOntModel m = new LockableOntModel(ontModel).read()) { ... }
-
-
Constructor Summary
Constructors Constructor Description LockableOntModel(org.apache.jena.ontology.OntModel ontModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockedOntModelread()LockedOntModelwrite()
-
-
-
Method Detail
-
read
public LockedOntModel read()
-
write
public LockedOntModel write()
-
-