* @param permissionString the specified java permission entry
* @return permission node
*/
private NonLiteral getPermissionOfAJavaPermEntry(
String permissionString) {
LockableMGraph systemGraph = getSystemGraph();
PlainLiteral javaPermEntry = new PlainLiteralImpl(permissionString);
Lock readLock = systemGraph.getLock().readLock();
readLock.lock();
try {
Iterator<Triple> javaPermTriples = systemGraph.filter(null,
PERMISSION.javaPermissionEntry, javaPermEntry);
if (javaPermTriples.hasNext()) {
return javaPermTriples.next().getSubject();
}
} finally {
readLock.unlock();
}
Lock writeLock = systemGraph.getLock().writeLock();
writeLock.lock();
try {
BNode result = new BNode();
systemGraph.add(new TripleImpl(result,
PERMISSION.javaPermissionEntry, javaPermEntry));
return result;
} finally {
writeLock.unlock();
}