|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.fluxion.utils.ReasonerSession
public class ReasonerSession
A ReasonerSession encapsulates an OWLReasoner and exposes it according to
semaphore leases given by a ReasonerSessionManager
.
This allows OWLReasoners to be made accessible as part of a connection pool.
Constructor Summary | |
---|---|
ReasonerSession(java.util.Set<org.semanticweb.owl.model.OWLOntology> ontologies)
Construct a new ReasonerSession given a set of ontologies. |
Method Summary | |
---|---|
void |
expire()
Empty the ReasonerSession of any previously loaded and classified ontologies. |
java.util.Set<org.semanticweb.owl.model.OWLOntology> |
forOntologies()
Retrieve the set of loaded ontologies from the underlying reasoner instance |
int |
getQueueSize()
Get the number of connections waiting for this ReasonerSession to become available. |
org.semanticweb.owl.inference.OWLReasoner |
getReasoner()
Expose the underlying OWLReasoner instance employed by this ReasonerSession |
boolean |
hasExpired()
Check whether this ReasonerSession has expired. |
boolean |
isLeased()
Check if this ReasonerSession is leased |
long |
lastLeased()
The time (in milliseconds) that this reasoner was last leased in the connection pool |
ReasonerSession |
leaseSession()
Acquire a ReasonerSession. |
ReasonerSession |
leaseSession(int timeout)
Acquire a ReasonerSession, if one becomes available within the given waiting time. |
void |
releaseSession()
Release this ReasonerSession for use by another connection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReasonerSession(java.util.Set<org.semanticweb.owl.model.OWLOntology> ontologies)
ReasonerSessionManager
ontologies
- the set of ontologies to load into the underlying
reasoner instanceMethod Detail |
---|
public java.util.Set<org.semanticweb.owl.model.OWLOntology> forOntologies()
public long lastLeased()
public boolean isLeased()
public ReasonerSession leaseSession(int timeout) throws java.lang.InterruptedException
timeout
- the length of time to wait, in SECONDS
java.lang.InterruptedException
- if there was a problem leasing a session, or
if this session has expiredpublic ReasonerSession leaseSession() throws java.lang.InterruptedException
releaseSession()
java.lang.InterruptedException
- if there was a problem acquiring a permit from
the lease semaphorepublic void releaseSession()
public void expire()
public boolean hasExpired()
public int getQueueSize()
public org.semanticweb.owl.inference.OWLReasoner getReasoner() throws org.semanticweb.owl.inference.OWLReasonerException
org.semanticweb.owl.inference.OWLReasonerException
- if this ReasonerSession hasn't been made
available to a ReasonerSessionManager
by leaseSession(int)
, or if the current
session has expired.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |