Examples of RepositoryCache


Examples of org.eclipse.egit.core.RepositoryCache

    SubmoduleWalk walk = SubmoduleWalk.forIndex(repo);
    try {
      while (walk.next()) {
        Repository subRepo = walk.getRepository();
        if (subRepo != null) {
          RepositoryCache cache = null;
          try {
            cache = org.eclipse.egit.core.Activator.getDefault()
                .getRepositoryCache();
          } finally {
            if (cache != null)
              cache.lookupRepository(subRepo.getDirectory())
                  .close();
            subRepo.close();
          }
        }
      }
View Full Code Here

Examples of org.eclipse.egit.core.RepositoryCache

   * @return a map containing a list of repository relative paths for each
   *         occurring repository
   */
  public static Map<Repository, Collection<String>> splitPathsByRepository(
      Collection<IPath> paths) {
    RepositoryCache repositoryCache = Activator.getDefault()
        .getRepositoryCache();
    Map<Repository, Collection<String>> result = new HashMap<Repository, Collection<String>>();
    for (IPath path : paths) {
      Repository repository = repositoryCache.getRepository(path);
      if (repository != null) {
        IPath repoPath = new Path(repository.getWorkTree()
            .getAbsolutePath());
        IPath repoRelativePath = path.makeRelativeTo(repoPath);
        addPathToMap(repository, repoRelativePath.toString(), result);
View Full Code Here

Examples of org.eclipse.egit.core.RepositoryCache

    @Override
    protected IStatus run(IProgressMonitor monitor) {
      // The core plugin might have been stopped before we could cancel
      // this job.
      RepositoryCache repositoryCache = org.eclipse.egit.core.Activator
          .getDefault().getRepositoryCache();
      if (repositoryCache == null)
        return Status.OK_STATUS;

      Repository[] repos = repositoryCache.getAllRepositories();
      if (repos.length == 0)
        return Status.OK_STATUS;

      // When people use Git from the command line a lot of changes
      // may happen. Don't scan when inactive depending on the user's
View Full Code Here

Examples of org.jbpm.pvm.internal.repository.RepositoryCache

   
    // removing deployment from the cache
    // next time it's used, it will be redeployed
    // at that time, the suspended property will be propagated to the
    // process definitions
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.remove(deploymentId);
   
    return null;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.repository.RepositoryCache

    Session session = environment.get(Session.class);
    DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
    log.debug("deleting deployment "+deploymentId);
    session.delete(deployment);
   
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.set(deploymentId, null);

    return null;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.repository.RepositoryCache

    Session session = environment.get(Session.class);
    DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
    log.debug("deleting deployment "+deploymentId);
    session.delete(deployment);
   
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.remove(deploymentId);

    return null;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.repository.RepositoryCache

   
    // removing deployment from the cache
    // next time it's used, it will be redeployed
    // at that time, the suspended property will be propagated to the
    // process definitions
    RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
    repositoryCache.remove(deploymentId);
   
    return null;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.repository.RepositoryCache

    }

    Thread currentThread = Thread.currentThread();
    ClassLoader original = currentThread.getContextClassLoader();

    RepositoryCache repositoryCache = EnvironmentImpl.getFromCurrent(RepositoryCache.class);
    DeploymentClassLoader deploymentClassLoader = repositoryCache.getDeploymentClassLoader(deploymentId, original);
    if (deploymentClassLoader==null) {
      deploymentClassLoader = new DeploymentClassLoader(original, deploymentId);
      repositoryCache.setDeploymentClassLoader(deploymentId, original, deploymentClassLoader);
    }
   
    currentThread.setContextClassLoader(deploymentClassLoader);
   
    return original;
View Full Code Here

Examples of org.modeshape.jcr.cache.RepositoryCache

                    // Set up the repository cache ...
                    String journalId = this.journal != null ? this.journal.journalId() : null;
                    final SessionEnvironment sessionEnv = new RepositorySessionEnvironment(this.transactions, journalId);
                    CacheContainer workspaceCacheContainer = this.config.getWorkspaceContentCacheContainer();
                    this.cache = new RepositoryCache(context, documentStore, clusteringService, config, systemContentInitializer,
                                                     sessionEnv, changeBus, workspaceCacheContainer, Upgrades.STANDARD_UPGRADES);

                    // Set up the node type manager ...
                    this.nodeTypes = new RepositoryNodeTypeManager(this, true, true);
                    this.changeBus.register(this.nodeTypes);
View Full Code Here

Examples of org.modeshape.jcr.cache.RepositoryCache

                          Map<String, Object> sessionAttributes,
                          boolean readOnly ) {
        this.repository = repository;

        // Get the node key of the workspace we're going to use ...
        final RepositoryCache repositoryCache = repository.repositoryCache();
        WorkspaceCache workspace = repositoryCache.getWorkspaceCache(workspaceName);
        NodeKey rootKey = workspace.getRootKey();

        // Now create a specific reference factories that know about the root node key ...
        TextDecoder decoder = context.getDecoder();
        ValueFactories factories = context.getValueFactories();
        ReferenceFactory rootKeyAwareStrongRefFactory = NodeIdentifierReferenceFactory.newInstance(rootKey, decoder, factories,
                                                                                                   false, false);
        ReferenceFactory rootKeyAwareWeakRefFactory = NodeIdentifierReferenceFactory.newInstance(rootKey, decoder, factories,
                                                                                                 true, false);
        ReferenceFactory rootKeyAwareSimpleRefFactory = NodeIdentifierReferenceFactory.newInstance(rootKey, decoder, factories,
                                                                                                   true, true);
        context = context.with(rootKeyAwareStrongRefFactory).with(rootKeyAwareWeakRefFactory).with(rootKeyAwareSimpleRefFactory);

        // Create an execution context for this session that uses a local namespace registry ...
        final NamespaceRegistry globalNamespaceRegistry = context.getNamespaceRegistry(); // thread-safe!
        final LocalNamespaceRegistry localRegistry = new LocalNamespaceRegistry(globalNamespaceRegistry); // not-thread-safe!
        this.context = context.with(localRegistry);
        this.sessionRegistry = new JcrNamespaceRegistry(Behavior.SESSION, localRegistry, globalNamespaceRegistry, this);
        this.workspace = new JcrWorkspace(this, workspaceName);

        // Create the session cache ...
        this.cache = repositoryCache.createSession(this.context, workspaceName, readOnly);
        this.rootNode = new JcrRootNode(this, this.cache.getRootKey());
        this.jcrNodes.put(this.rootNode.key(), this.rootNode);
        this.sessionAttributes = sessionAttributes != null ? sessionAttributes : Collections.<String, Object>emptyMap();

        // Pre-cache all of the namespaces to be a snapshot of what's in the global registry at this time.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.