org.apache.clerezza.commons.rdf.Graph.getLock()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.apache.clerezza.commons.rdf.Graph.getLock()方法的一些代码示例,展示了Graph.getLock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getLock()方法的具体详情如下:
包路径:org.apache.clerezza.commons.rdf.Graph
类名称:Graph
方法名:getLock

Graph.getLock介绍

暂无

代码示例

代码示例来源:origin: org.apache.clerezza/rdf.core

@Override
public ReadWriteLock getLock() {
  return wrapped.getLock();
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.enhancer.servicesapi

@Override
public final ReadWriteLock getLock() {
  return metadata.getLock();
}

代码示例来源:origin: org.apache.clerezza.commons-rdf/commons-rdf-impl-utils

@Override
public ReadWriteLock getLock() {
  return wrapped.getLock();
}

代码示例来源:origin: apache/stanbol

@Override
public final ReadWriteLock getLock() {
  return metadata.getLock();
}

代码示例来源:origin: org.apache.clerezza/rdf.core

@Override
public ReadWriteLock getLock() {
  return graph.getLock();
}

代码示例来源:origin: org.apache.clerezza/rdf.core.test

@Override
public ReadWriteLock getLock() {
  return wrapped.getLock();
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.commons.ldpath.clerezza

/**
 * @return the readLock or <code>null</code>if no read lock is needed
 */
private Lock readLockGraph() {
  final Lock readLock;
  readLock = graph.getLock().readLock();
  readLock.lock();
  return readLock;
}

代码示例来源:origin: apache/stanbol

/**
 * @return the readLock or <code>null</code>if no read lock is needed
 */
private Lock readLockGraph() {
  final Lock readLock;
  readLock = graph.getLock().readLock();
  readLock.lock();
  return readLock;
}
/**

代码示例来源:origin: apache/stanbol

/**
 * @return the readLock or <code>null</code>if no read lock is needed
 */
private Lock readLockGraph() {
  final Lock readLock;
  readLock = graph.getLock().readLock();
  readLock.lock();
  return readLock;
}

代码示例来源:origin: org.apache.clerezza/rdf.utils

/**
   *
   * @return
   */
  public Lock writeLock() {

      return (getGraph()).getLock().writeLock();

  }
}

代码示例来源:origin: apache/clerezza

/**
 * @return a ReadLock if the underlying ImmutableGraph is a LockableGraph it returns its lock, otherwise null
 */
public Lock readLock() {
    return getGraph().getLock().readLock();
}

代码示例来源:origin: apache/clerezza

/**
   *
   * @return
   */
  public Lock writeLock() {

      return (getGraph()).getLock().writeLock();

  }
}

代码示例来源:origin: org.apache.clerezza/rdf.utils

/**
 * @return a ReadLock if the underlying ImmutableGraph is a LockableGraph it returns its lock, otherwise null
 */
public Lock readLock() {
    return getGraph().getLock().readLock();
}

代码示例来源:origin: org.apache.clerezza/rdf.utils

private Lock getPartialReadLock(int startPos) {
  ArrayList<Lock> resultList = new ArrayList<Lock>();
  for (int i = startPos; i < baseTripleCollections.length; i++) {
    Graph graph = baseTripleCollections[i];
    final Lock lock = graph.getLock().readLock();
    resultList.add(lock);
  }
  return new UnionLock(resultList.toArray(new Lock[resultList.size()]));
}

代码示例来源:origin: apache/clerezza

private Lock getPartialReadLock(int startPos) {
  ArrayList<Lock> resultList = new ArrayList<Lock>();
  for (int i = startPos; i < baseTripleCollections.length; i++) {
    Graph graph = baseTripleCollections[i];
    final Lock lock = graph.getLock().readLock();
    resultList.add(lock);
  }
  return new UnionLock(resultList.toArray(new Lock[resultList.size()]));
}

代码示例来源:origin: apache/stanbol

@PUT
@Path("users/{username}")
@Consumes(SupportedFormat.TURTLE)
public Response createUser(@Context UriInfo uriInfo, @PathParam("username") String userName, ImmutableGraph inputGraph) {
  Lock writeLock = systemGraph.getLock().writeLock();
  writeLock.lock();
  systemGraph.addAll(inputGraph);
  writeLock.unlock();
  UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
  URI createdResource = uriBuilder.replacePath("/user-management/users/" + userName).build();
  return Response.created(createdResource).build();
}

代码示例来源:origin: org.apache.clerezza/platform.usermanager

@Override
public boolean nameExists(String name) {
  Graph systemGraph = getSystemGraph();
  Lock readLock = systemGraph.getLock().readLock();
  readLock.lock();
  try {
    return systemGraph.filter(null, PLATFORM.userName,
      new PlainLiteralImpl(name)).hasNext();
  } finally {
    readLock.unlock();
  }        
}

代码示例来源:origin: org.apache.clerezza/platform.usermanager

@Override
public boolean emailExists(String email) {
  Graph systemGraph = getSystemGraph();
  Lock readLock = systemGraph.getLock().readLock();
  readLock.lock();
  try {
    return systemGraph.filter(null, FOAF.mbox,
        new IRI("mailto:" + email)).hasNext();
  } finally {
    readLock.unlock();
  }
}

代码示例来源:origin: org.apache.clerezza/rdf.utils

private Lock createWriteLock() {
  Lock partialReadLock = getPartialReadLock(1);
  Lock baseWriteLock
      = (baseTripleCollections[0]).getLock().writeLock();
  return new UnionLock(baseWriteLock, partialReadLock);
}

代码示例来源:origin: apache/clerezza

private Lock createWriteLock() {
  Lock partialReadLock = getPartialReadLock(1);
  Lock baseWriteLock
      = (baseTripleCollections[0]).getLock().writeLock();
  return new UnionLock(baseWriteLock, partialReadLock);
}

相关文章