Package org.apache.jackrabbit.core.config

Examples of org.apache.jackrabbit.core.config.RepositoryConfig


     * @return a new jcr repository.
     * @throws RepositoryException if an error during creation occurs.
     */
    protected Repository createRepository(InputSource is, File homedir)
            throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(is, homedir.getAbsolutePath());
        return RepositoryImpl.create(config);
    }
View Full Code Here


    }

    public void repositoryStart() throws Exception {
        InputStream config = getClass().getResourceAsStream("/repository.xml");
        String home = new File("cltest").getAbsolutePath();
        RepositoryConfig rc = RepositoryConfig.create(config, home);
        RepositoryImpl repository = RepositoryImpl.create(rc);

        try {
            Context ctx = getInitialContext();
            ctx.bind(REPOSITORY_NAME, repository);
View Full Code Here

     * when the JVM shuts down.
     *
     * @throws RepositoryException if the repository cannot be created
     */
    protected void init() throws RepositoryException {
        RepositoryConfig config = createRepositoryConfig(configFilePath, repHomeDir);
        delegatee = createRepository(config);
        hook = new Thread() {
            public void run() {
                shutdown();
            }
View Full Code Here

                } catch (Exception e) {
                    // Not running within the main test suite
                    InputStream xml =
                        TestRepository.class.getResourceAsStream(CONF_RESOURCE);
                    String home = System.getProperty(HOME_PROPERTY, HOME_DEFAULT);
                    RepositoryConfig config = RepositoryConfig.create(xml, home);
                    instance = new TransientRepository(config);
                }
            }
            return instance;
        } catch (ConfigurationException e) {
View Full Code Here

                    if (!homeDir.exists()) {
                        logger.info("Creating repository home directory " + home);
                        homeDir.mkdirs();
                    }
                    // Load the configuration and create the repository
                    RepositoryConfig rc = RepositoryConfig.create(config, home);
                    return RepositoryImpl.create(rc);
                } catch (IOException e) {
                    throw new RepositoryException(
                            "Automatic repository configuration failed", e);
                } catch (ConfigurationException e) {
View Full Code Here

       
        pmc = conf.getVersioningConf().getPersistenceManagerConf();
        pmc.setParameter("url", PROTOCOL + "${rep.home}" + VERSIONING_DB_PATH + ";create=true");
        pmc.setParameter("schemaObjectPrefix", "VERSION_");
        try {
            RepositoryConfig config = conf.createConfig(DIRECTORY.getPath());
            config.init();
            return new AdminRepositoryImpl(config);
        } catch (Exception e) {
            fail("Could not create repository for test: " + e);
            return null;
        }
View Full Code Here

        pmc.setParameter("user", USER);
        pmc.setParameter("password", PASSWORD);
        // false is the default value anyway, but we want to make sure, the code does not block forever
        pmc.setParameter("blockOnConnectionLoss", "false");

        RepositoryConfig config = conf.createConfig(directory.getPath());
        config.init();
        repository = RepositoryImpl.create(config);
    }
View Full Code Here

  }

  public void testStartRepoWithDynamicConfigFromXml() throws Exception {
    RepositoryConf conf = getRepositoryConf();
   
    RepositoryConfig config = conf.createConfig("applications/test");
    config.init();
    TransientRepository repo = new TransientRepository(config);
    repo.login();
    repo.shutdown();
  }
View Full Code Here

    RepositoryConf conf = new RepositoryConf();
    System.out.println(">>>>>>>>>> Default config:");
    conf.print(new PrettyPrinter(System.out));
    System.out.println();
   
    RepositoryConfig config = conf.createConfig("applications/test2");
    config.init();
    TransientRepository repo = new TransientRepository(config);
    repo.login();
    repo.shutdown();
  }
View Full Code Here

    readonly = new SimpleCredentials("anonymous", "".toCharArray());
  }

  public Repository getRepository() throws RepositoryException {
    if (repo == null) {
      RepositoryConfig config = conf.createConfig(home);
      config.init();
      try {
        repo = new TransientRepository(config);
      } catch (IOException e) {
        throw new RepositoryException("Cannot instantiate " +
            "TransientRepository at " + home, e);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.config.RepositoryConfig

Copyright © 2018 www.massapicom. 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.