Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.TransientRepository$RepositoryFactory


     * @see org.drools.repository.RepositoryConfigurator#getJCRRepository()
     */
    public Repository getJCRRepository(String repoRootDir) {

            if (repoRootDir == null) {
                return new TransientRepository();
            } else {
                return new TransientRepository(repoRootDir + "/repository.xml", repoRootDir);
            }

    }
View Full Code Here


        File confFile = new File( "src/test/repository.xml" );
        File dir = new File( "target/jcr" );
        FileUtils.deleteDirectory( dir );

        TransientRepository repository = new TransientRepository( confFile, dir );
        session = repository.login( new SimpleCredentials( "username", "password".toCharArray() ) );

        // TODO: perhaps have an archiva-jcr-utils module shared by these plugins that does this and can contain
        //      structure information
        Workspace workspace = session.getWorkspace();
        NamespaceRegistry registry = workspace.getNamespaceRegistry();
View Full Code Here

    PropertyManager core = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE);
    core.setProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY, "org.mockejb.jndi.MockContextFactory");
    core.setProperty(Environment.JNDI_SERVER_PKG_PREFIX, "org.mockejb.jndi");
    Repository repository = null;
    try {
      repository = new TransientRepository();
    } catch (IOException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
    Context ctx;
View Full Code Here

   * @throws RepositoryException
   */
  protected Repository initRepository(File config, File home) throws RepositoryException {
    RepositoryConfig rconfig = RepositoryConfig.create(config.getPath(), home.getPath());
    try {
      return new TransientRepository(rconfig);
    } catch (IOException e) {
      throw new RepositoryException(e);
    }
  }
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

        FileUtils.deleteDirectory( dir );

        assertTrue( confFile.exists() );
        assertFalse( dir.exists() );

        TransientRepository repository = new TransientRepository( confFile, dir );
        session = repository.login( new SimpleCredentials( "username", "password".toCharArray() ) );

        // TODO: perhaps have an archiva-jcr-utils module shared by these plugins that does this and can contain
        //      structure information
        Workspace workspace = session.getWorkspace();
        NamespaceRegistry registry = workspace.getNamespaceRegistry();
View Full Code Here

     */
    private synchronized void initializeRepository() {
        logger.fine("Initializing JCR repository");
        try {
            if( repository == null) {
                repository = new TransientRepository(new File(repositoryHome));
            }
            session = repository.login(new SimpleCredentials("photarkUser", "passwordDoesNotMatter".toCharArray()));               
        } catch (Exception e) {
            logger.log(Level.INFO, ">>>Error initializing JCR repository : " + e.getMessage(), e);
        }
View Full Code Here

        File config = new File(CONFIG_FILE);
        if (!config.exists()) {
            throw new Exception("missing config file: " + config.getPath());
        }
        repository = new TransientRepository(CONFIG_FILE, "target/repository");

        // set up a user to authenticate
        SessionImpl session = (SessionImpl) repository
                .login(new SimpleCredentials("admin", "admin".toCharArray()));
        UserManager userManager = session.getUserManager();
View Full Code Here

public class TransactionTest {
   
    public static void main(String[] args) throws Exception {
        //RepositoryConfig config = RepositoryConfig.create(new FileInputStream(new File("C:/tmp/repository.xml")), "C:/tmp/repository");
        TransientRepository repository = new TransientRepository();//RepositoryImpl.create(config);
     
        for (int i = 0; i < 10000; i++) {
           
           Session session = repository.login( new SimpleCredentials("username", "password".toCharArray()));
           try {
//               UserTransaction tx = new UserTransactionImpl(session);
//               try {
//                   tx.begin();
                    for (int j = 0; j < 10; j++) {
View Full Code Here

import org.apache.jackrabbit.core.TransientRepository;

public class VersioningTest {
   
    public static void main(String[] args) throws Exception {
        TransientRepository repository = new TransientRepository();     
        Session session = null;
        try {
            session = repository.login( new SimpleCredentials("nicolas.belisle@paypal.com", "perfectpassword4paypal".toCharArray()));
           
            Node rootNode = session.getRootNode();
            Node testNode = rootNode.addNode("test");
            testNode.addMixin("mix:versionable");
            String vhUuid = testNode.getVersionHistory().getUUID();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.TransientRepository$RepositoryFactory

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.