org.eclipse.rdf4j.repository.Repository.shutDown()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(119)

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

Repository.shutDown介绍

[英]Shuts the repository down, releasing any resources that it keeps hold of. Once shut down, the repository can no longer be used until it is re-initialized.
[中]关闭存储库,释放它保留的所有资源。一旦关闭,存储库在重新初始化之前将无法再使用。

代码示例

代码示例来源:origin: ontop/ontop

@Override
protected void tearDown()
  throws Exception
{
  if (dataRep != null) {
    dataRep.shutDown();
    dataRep = null;
  }
}

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-shacl

private void cleanup() {
  if (addedStatements != null) {
    addedStatements.shutDown();
    addedStatements = null;
  }
  if (removedStatements != null) {
    removedStatements.shutDown();
    removedStatements = null;
  }
  addedStatementsSet.clear();
  removedStatementsSet.clear();
  stats = null;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-shacl

private void cleanup() {
  if (addedStatements != null) {
    addedStatements.shutDown();
    addedStatements = null;
  }
  if (removedStatements != null) {
    removedStatements.shutDown();
    removedStatements = null;
  }
  addedStatementsSet.clear();
  removedStatementsSet.clear();
  stats = null;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-sail

@Override
  protected void shutDownInternal()
    throws RepositoryException
  {
    getProxiedRepository().shutDown();
  }
}

代码示例来源:origin: eclipse/rdf4j

@Override
public void shutDown()
  throws RepositoryException
{
  getDelegate().shutDown();
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

public void shutDown()
  throws RepositoryException
{
  getDelegate().shutDown();
}

代码示例来源:origin: joshsh/sesametools

protected void shutDownInternal() throws SailException {
    try {
      repository.shutDown();
    } catch (RepositoryException e) {
      throw new SailException(e);
    }
  }
}

代码示例来源:origin: it.tidalwave.bluemarine2/it-tidalwave-bluemarine2-persistence

/*******************************************************************************************************************
 *
 *
 ******************************************************************************************************************/
@VisibleForTesting void onPowerOffNotification (final @ListensTo @Nonnull PowerOffNotification notification)
 throws RepositoryException, IOException, RDFParseException
 {
  log.info("onPowerOffNotification({})", notification);
  if (repository != null)
   {
    repository.shutDown();
   }
 }

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

protected void updateInitializedRepositories() {
  synchronized (initializedRepositories) {
    Iterator<Repository> iter = initializedRepositories.values().iterator();
    while (iter.hasNext()) {
      Repository next = iter.next();
      if (!next.isInitialized()) {
        iter.remove();
        try {
          next.shutDown();
        } catch(RepositoryException e) {
          
        }
      }
    }
  }
}

代码示例来源:origin: eclipse/rdf4j

protected void updateInitializedRepositories() {
  synchronized (initializedRepositories) {
    Iterator<Repository> iter = initializedRepositories.values().iterator();
    while (iter.hasNext()) {
      Repository next = iter.next();
      if (!next.isInitialized()) {
        iter.remove();
        try {
          next.shutDown();
        }
        catch (RepositoryException e) {
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

void refreshRepository(String repositoryID, Repository repository) {
  logger.debug("Refreshing repository {}...", repositoryID);
  try {
    if (repository.isInitialized()) {
      repository.shutDown();
    }
  }
  catch (RepositoryException e) {
    logger.error("Failed to shut down repository", e);
  }
  cleanupIfRemoved(repositoryID);
}

代码示例来源:origin: eclipse/rdf4j

void refreshRepository(String repositoryID, Repository repository) {
  logger.debug("Refreshing repository {}...", repositoryID);
  try {
    if (repository.isInitialized()) {
      repository.shutDown();
    }
  }
  catch (RepositoryException e) {
    logger.error("Failed to shut down repository", e);
  }
  cleanupIfRemoved(repositoryID);
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Shuts down all initialized repositories, including the SYSTEM repository.
 * 
 * @see #refresh()
 */
public void shutDown() {
  synchronized (initializedRepositories) {
    updateInitializedRepositories();
    for (Repository repository : initializedRepositories.values()) {
      try {
        if (repository.isInitialized()) {
          repository.shutDown();
        }
      }
      catch (RepositoryException e) {
        logger.error("Repository shut down failed", e);
      }
    }
    initializedRepositories.clear();
    initialized = false;
  }
}

代码示例来源:origin: eclipse/rdf4j

/**
 * Shuts down all initialized repositories, including the SYSTEM repository.
 * 
 * @see #refresh()
 */
public void shutDown() {
  synchronized (initializedRepositories) {
    updateInitializedRepositories();
    for (Repository repository : initializedRepositories.values()) {
      try {
        if (repository.isInitialized()) {
          repository.shutDown();
        }
      }
      catch (RepositoryException e) {
        logger.error("Repository shut down failed", e);
      }
    }
    initializedRepositories.clear();
    initialized = false;
  }
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

@Override
  public void shutDown()
    throws RepositoryException
  {
    boolean denied = false;
    if (activated) {
      for (RepositoryInterceptor interceptor : interceptors) {
        denied = interceptor.shutDown(getDelegate());
        if (denied) {
          break;
        }
      }
    }
    if (!denied) {
      getDelegate().shutDown();
    }
  }
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-event

@Override
  public void shutDown()
    throws RepositoryException
  {
    boolean denied = false;
    if (activated) {
      for (RepositoryInterceptor interceptor : interceptors) {
        denied = interceptor.shutDown(getDelegate());
        if (denied) {
          break;
        }
      }
    }
    if (!denied) {
      getDelegate().shutDown();
    }
  }
}

代码示例来源:origin: eclipse/rdf4j

@Override
  public void shutDown()
    throws RepositoryException
  {
    boolean denied = false;
    if (activated) {
      for (RepositoryInterceptor interceptor : interceptors) {
        denied = interceptor.shutDown(getDelegate());
        if (denied) {
          break;
        }
      }
    }
    if (!denied) {
      getDelegate().shutDown();
    }
  }
}

代码示例来源:origin: franzinc/agraph-java-client

/**
 * @throws java.lang.Exception
 */
@After
public void tearDown()
    throws Exception {
  logger.debug("tearing down...");
  con.close();
  con = null;
  rep.shutDown();
  rep = null;
  logger.debug("tearDown complete.");
}

代码示例来源:origin: franzinc/agraph-java-client

@After
public void tearDown()
    throws Exception {
  if (testCon2 != null) {
    testCon2.close();
    testCon2 = null;
  }
  if (testCon != null) {
    testCon.close();
    testCon = null;
  }
  if (testRepository != null) {
    testRepository.shutDown();
    testRepository = null;
  }
  vf = null;
}

代码示例来源:origin: franzinc/agraph-java-client

@Test
public void testAddStatement()
    throws Exception {
  testCon.add(bob, name, nameBob);
  assertTrue("Repository should contain newly added statement", testCon.hasStatement(bob, name, nameBob,
      false));
  Statement statement = vf.createStatement(alice, name, nameAlice);
  testCon.add(statement);
  assertTrue("Repository should contain newly added statement", testCon.hasStatement(statement, false));
  assertTrue("Repository should contain newly added statement", testCon.hasStatement(alice, name,
      nameAlice, false));
  Repository tempRep = new SailRepository(new MemoryStore());
  tempRep.initialize();
  RepositoryConnection con = tempRep.getConnection();
  con.add(testCon.getStatements(null, null, null, false));
  assertTrue("Temp Repository should contain newly added statement", con.hasStatement(bob, name, nameBob,
      false));
  con.close();
  tempRep.shutDown();
}

相关文章