Examples of RepositoryService


Examples of org.eclipse.egit.github.core.service.RepositoryService

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubRepositoryService");
        if (service != null) {
            repositoryService = (RepositoryService) service;
        } else {
            repositoryService = new RepositoryService();
        }
        initService(repositoryService);
        repository = repositoryService.getRepository(endpoint.getRepoOwner(), endpoint.getRepoName());
    }
View Full Code Here

Examples of org.exoplatform.services.jcr.RepositoryService

      public WSRPSessionLifeCycle()
      {
         try
         {
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
            repository = repoService.getRepository(REPOSITORY_NAME);
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.RepositoryService

      public PortletStatesSessionLifeCycle()
      {
         try
         {
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
            repository = repoService.getRepository(REPOSITORY_NAME);
         }
         catch (Exception e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.RepositoryService

{

   public void testWorkspace() throws Exception
   {
      PortalContainer container = PortalContainer.getInstance();
      RepositoryService repos = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
      assertNotNull(repos);
      ManageableRepository repo = repos.getDefaultRepository();
      assertNotNull(repo);
      Session session = repo.getSystemSession("portal-test");
      assertNotNull(session);
      session.logout();
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.RepositoryService

      ExoContainer container = getContainer();
      if (LOG.isDebugEnabled())
      {
         LOG.debug("createManagedConnection: container = " + container.getContext().getName());
      }
      RepositoryService rs = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
      if (rs == null)
      {
         throw new ResourceException("No RepositoryService could be found in the container "
            + container.getContext().getName());
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.RepositoryService

      }

      SessionProviderService sessionProviderService =
         (SessionProviderService)container.getComponentInstanceOfType(SessionProviderService.class);

      RepositoryService repositoryService =
         (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);

      try
      {

         if (ConversationState.getCurrent() != null)
         {

            if (jcrBrowser != null && jcrBrowser.getNode() != null)
            {
               // navigate through JCR Repository

               String repositoryName = (String)httpRequest.getParameter("repositoryName");
               String workspaceName = (String)httpRequest.getParameter("workspaceName");

               // check if browser related to repository/workspace given in attrs
               if (repositoryName != null
                  && !jcrBrowser.getRepository().getConfiguration().getName().equals(repositoryName))
               {
                  // ask repositoryService and if not found lookup JNDI by given name
                  try
                  {
                     jcrBrowser.setRepository(repositoryService.getRepository(repositoryName));
                  }
                  catch (RepositoryException e)
                  {
                     if (e.getMessage().indexOf("not found") > 0)
                     {
                        // check in JNDI
                        LOG.warn("Repository '" + repositoryName + "' is not local. Trying JNDI lookup with the name.");
                        ManageableRepository jndiRepo;
                        try
                        {
                           InitialContext ctx = new InitialContext();
                           Object obj = ctx.lookup(repositoryName);
                           if (obj instanceof ManageableRepository)
                           {
                              jndiRepo = (ManageableRepository)obj;
                           }
                           else
                           {
                              obj = ctx.lookup("java:comp/env/" + repositoryName);
                              if (obj instanceof ManageableRepository)
                              {
                                 jndiRepo = (ManageableRepository)obj;
                              }
                              else
                              {
                                 LOG.warn("Can't cast object " + obj + " as ManageableRepository class object");
                                 jndiRepo = null;
                              }
                           }
                           if (jndiRepo == null)
                              jcrBrowser.addError(e);
                           else
                              jcrBrowser.setRepository(jndiRepo);
                        }
                        catch (NamingException jndie)
                        {
                           LOG.warn("Repository not bound in JNDI with one of names '" + repositoryName
                              + "', 'java:comp/env/" + repositoryName + "' or can't be connected.", jndie);
                           try
                           {
                              InitialContext ctx = new InitialContext();
                              Object obj = ctx.lookup("java:comp/env/jcr/" + repositoryName);
                              if (obj instanceof ManageableRepository)
                              {
                                 jndiRepo = (ManageableRepository)obj;
                              }
                              else
                              {
                                 LOG.warn("Can't cast object " + obj + " as ManageableRepository class object");
                                 jndiRepo = null;
                              }
                              if (jndiRepo == null)
                              {
                                 jcrBrowser.addError(e);
                                 jcrBrowser.addError(jndie);
                              }
                              else
                                 jcrBrowser.setRepository(jndiRepo);
                           }
                           catch (NamingException jndie1)
                           {
                              LOG.warn("Repository not bound in JNDI with name 'java:comp/env/jcr/" + repositoryName
                                 + "' or can't be connected.", jndie1);
                              jcrBrowser.addError(e);
                              jcrBrowser.addError(jndie);
                              jcrBrowser.addError(jndie1);
                           }
                        }
                     }
                  }
               }

               if (jcrBrowser.getRepository() != null)
               {

                  if (workspaceName != null && !jcrBrowser.getSession().getWorkspace().getName().equals(workspaceName))
                  {
                     jcrBrowser.setSession(sessionProviderService.getSessionProvider(null).getSession(workspaceName,
                        jcrBrowser.getRepository()));
                  }

                  // Navigation
                  String path = (String)httpRequest.getParameter("goParent");
                  if (path != null)
                  {
                     jcrBrowser.setNode(jcrBrowser.getNode().getNode(path));
                  }
                  else
                  {
                     path = (String)httpRequest.getParameter("goNodePath");
                     if (path != null)
                        jcrBrowser.setNode((Node)jcrBrowser.getSession().getItem(path));
                     // else seems nothing changed in JCR navigation
                  }

                  // Synchronization
                  String doSynchronize = (String)httpRequest.getParameter("synchronize");
                  if (doSynchronize != null && doSynchronize.equals("run"))
                  {
                     jcrBrowser.runSynchronization();
                  }

               }
            }
            else
            {
               // start from root node

               ManageableRepository repository = repositoryService.getDefaultRepository();

               Session jcrSession =
                  sessionProviderService.getSessionProvider(null).getSession(
                     repository.getConfiguration().getDefaultWorkspaceName(), repository);
View Full Code Here

Examples of org.gitective.core.RepositoryService

  /**
   * Test constructor with null repositories
   */
  @Test(expected = IllegalArgumentException.class)
  public void nullStringDirectories() {
    new RepositoryService((String[]) null);
  }
View Full Code Here

Examples of org.guvnor.structure.repositories.RepositoryService

    public ExecutionResults execute(CommandContext commandContext) throws Exception {

        String gitRepo = (String) getParameter(commandContext, "GitRepository");
        BeanManager beanManager = CDIUtils.lookUpBeanManager(commandContext);
        logger.debug("BeanManager " + beanManager);
        RepositoryService repositoryService = CDIUtils.createBean(RepositoryService.class, beanManager);

        Repository repository = repositoryService.getRepository(gitRepo);
        if (repository == null) {
            throw new IllegalArgumentException("No repository found for alias " + gitRepo);
        }

        Collection<String> branchNames = repository.getBranches();
View Full Code Here

Examples of org.jbpm.api.RepositoryService

    try
    {
      List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();

      RepositoryService repositoryService = this.processEngine.getRepositoryService();

      // active processes
      List<ProcessDefinition> activePds = repositoryService.createProcessDefinitionQuery()
          .notSuspended()
          .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
          .list();
    
      for(ProcessDefinition processDefinition : activePds)
      {
        ProcessDefinitionRef ref = ModelAdaptor.adoptDefinition(processDefinition);
        results.add(ref);
      }

      // suspended  processes
      ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
      pdQuery2.suspended();
      List<ProcessDefinition> suspendedPds = pdQuery2.list();

      for(ProcessDefinition p : suspendedPds)
      {
View Full Code Here

Examples of org.modeshape.jboss.service.RepositoryService

        // security
        parseSecurity(context, model, configDoc);

        // Now create the repository service that manages the lifecycle of the JcrRepository instance ...
        RepositoryConfiguration repositoryConfig = new RepositoryConfiguration(configDoc, repositoryName);
        RepositoryService repositoryService = new RepositoryService(repositoryConfig);

        // Journaling
        parseJournaling(repositoryService, context, model, configDoc);

        ServiceName repositoryServiceName = ModeShapeServiceNames.repositoryServiceName(repositoryName);

        // Add the EngineService's dependencies ...
        ServiceBuilder<JcrRepository> repositoryServiceBuilder = target.addService(repositoryServiceName, repositoryService);

        // Add dependency to the ModeShape engine service ...
        repositoryServiceBuilder.addDependency(ModeShapeServiceNames.ENGINE,
                                               ModeShapeEngine.class,
                                               repositoryService.getEngineInjector());
        repositoryServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);

        // Add garbage collection information ...
        if (gcThreadPool != null) {
            configDoc.getOrCreateDocument(FieldName.GARBAGE_COLLECTION).setString(FieldName.THREAD_POOL, gcThreadPool);
        }
        if (gcInitialTime != null) {
            configDoc.getOrCreateDocument(FieldName.GARBAGE_COLLECTION).setString(FieldName.INITIAL_TIME, gcInitialTime);
        }
        configDoc.getOrCreateDocument(FieldName.GARBAGE_COLLECTION).setNumber(FieldName.INTERVAL_IN_HOURS, gcIntervalInHours);

        // Add document optimization information ...
        if (optTarget != null) {
            EditableDocument docOpt = configDoc.getOrCreateDocument(FieldName.STORAGE)
                                               .getOrCreateDocument(FieldName.DOCUMENT_OPTIMIZATION);
            if (optThreadPool != null) {
                docOpt.setString(FieldName.THREAD_POOL, optThreadPool);
            }
            if (optInitialTime != null) {
                docOpt.setString(FieldName.INITIAL_TIME, optInitialTime);
            }
            docOpt.setNumber(FieldName.INTERVAL_IN_HOURS, optIntervalInHours);
            docOpt.setNumber(FieldName.OPTIMIZATION_CHILD_COUNT_TARGET, optTarget.intValue());
            if (optTolerance != null) {
                docOpt.setNumber(FieldName.OPTIMIZATION_CHILD_COUNT_TOLERANCE, optTolerance.intValue());
            }
        }

        // Add dependency to the Infinispan cache container used for content ...
        repositoryServiceBuilder.addDependency(ServiceName.JBOSS.append("infinispan", namedContainer),
                                               CacheContainer.class,
                                               repositoryService.getCacheManagerInjector());

        // Add dependency, if necessary, to the workspaces cache container
        String workspacesCacheContainer = attribute(context, model, ModelAttributes.WORKSPACES_CACHE_CONTAINER, null);
        if (workspacesCacheContainer != null && !workspacesCacheContainer.toLowerCase().equalsIgnoreCase(namedContainer)) {
            // there is a different ISPN container configured for the ws caches
            repositoryServiceBuilder.addDependency(ServiceName.JBOSS.append("infinispan", workspacesCacheContainer),
                                                   CacheContainer.class,
                                                   repositoryService.getWorkspacesCacheContainerInjector());
            // the name is a constant which will be resolved later by the RepositoryService
            workspacesDoc.set(FieldName.WORKSPACE_CACHE_CONFIGURATION, RepositoryService.WORKSPACES_CONTAINER_NAME);
        }

        repositoryServiceBuilder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER,
                                               ModuleLoader.class,
                                               repositoryService.getModuleLoaderInjector());

        // Add dependency to the binaries storage service, which captures the properties for the binaries storage
        repositoryServiceBuilder.addDependency(ModeShapeServiceNames.binaryStorageDefaultServiceName(repositoryName),
                                               BinaryStorage.class,
                                               repositoryService.getBinaryStorageInjector());

        // Set up the JNDI binder service ...
        final ReferenceFactoryService<JcrRepository> referenceFactoryService = new ReferenceFactoryService<JcrRepository>();
        ServiceName referenceFactoryServiceName = ModeShapeServiceNames.referenceFactoryServiceName(repositoryName);
        final ServiceBuilder<?> referenceBuilder = target.addService(referenceFactoryServiceName, referenceFactoryService);
        referenceBuilder.addDependency(repositoryServiceName, JcrRepository.class, referenceFactoryService.getInjector());
        referenceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);

        ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
        BinderService binder = new BinderService(bindInfo.getBindName());
        ServiceBuilder<?> binderBuilder = target.addService(bindInfo.getBinderServiceName(), binder);
        if (jndiAlias != null) {
            ContextNames.BindInfo aliasInfo = ContextNames.bindInfoFor(jndiAlias);
            ServiceName alias = aliasInfo.getBinderServiceName();
            binderBuilder.addAliases(alias);
            LOG.debugv("Binding repository {0} to JNDI name {1} and {2}",
                       repositoryName,
                       bindInfo.getAbsoluteJndiName(),
                       aliasInfo.getAbsoluteJndiName());
        } else {
            LOG.debugv("Binding repository {0} to JNDI name {1}", repositoryName, bindInfo.getAbsoluteJndiName());
        }
        binderBuilder.addDependency(referenceFactoryServiceName, ManagedReferenceFactory.class, binder.getManagedObjectInjector());
        binderBuilder.addDependency(bindInfo.getParentContextServiceName(),
                                    ServiceBasedNamingStore.class,
                                    binder.getNamingStoreInjector());
        binderBuilder.setInitialMode(ServiceController.Mode.ACTIVE);

        // Add dependency to the data directory ...
        ServiceName dataDirServiceName = ModeShapeServiceNames.dataDirectoryServiceName(repositoryName);
        ServiceController<String> dataDirServiceController = RelativePathService.addService(dataDirServiceName,
                                                                                            "modeshape/" + repositoryName,
                                                                                            ModeShapeExtension.JBOSS_DATA_DIR_VARIABLE,
                                                                                            target);
        newControllers.add(dataDirServiceController);
        repositoryServiceBuilder.addDependency(dataDirServiceName, String.class, repositoryService.getDataDirectoryPathInjector());

        // Add the default binary storage service which will provide the binary configuration
        BinaryStorageService defaultBinaryService = new BinaryStorageService(repositoryName);
        ServiceBuilder<BinaryStorage> binaryStorageBuilder = target.addService(ModeShapeServiceNames.binaryStorageDefaultServiceName(repositoryName),
                                                                               defaultBinaryService);
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.