Package org.apache.geronimo.kernel.repository

Examples of org.apache.geronimo.kernel.repository.Repository


        outputPath.mkdirs();
        new File(outputPath, "war").mkdir();
        File path = new File(basedir, "src/test-resources/deployables/war4");
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        module.setEarContext(earContext);
        builder.initContext(earContext, module, cl);
View Full Code Here


        outputPath.mkdirs();
        new File(outputPath, "war").mkdir();
        File path = new File(basedir, "src/test-resources/deployables/war-spaces-in-context");
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        module.setEarContext(earContext);
        builder.initContext(earContext, module, cl);
View Full Code Here

        }
        // Step 2: check if it's in a repository
        Set repos = kernel.listGBeans(new AbstractNameQuery(Repository.class.getName()));
        for (Iterator it = repos.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            Repository repo = (Repository) kernel.getProxyManager().createProxy(name, Repository.class);
            if(repo.contains(configId)) {
                File path = repo.getLocation(configId);
                if(!path.exists()) throw new IllegalStateException("Can't find file '"+path.getAbsolutePath()+"' though repository said there's an artifact there!");
                response.setContentType("application/zip");
                if(!reply) {
                    return true;
                }
View Full Code Here

        return new ConfigurationResolver(configurationId, artifactResolver, repositories, childBaseDir, configurationStore, moduleName);
    }

    public File resolve(Artifact artifact) throws MissingDependencyException {
        for (Iterator j = repositories.iterator(); j.hasNext();) {
            Repository repository = (Repository) j.next();
            if (repository.contains(artifact)) {
                File file = repository.getLocation(artifact);
                return file;
            }
        }
        throw new MissingDependencyException("Unable to resolve dependency " + artifact);
    }
View Full Code Here

    }

    private ArrayList getChildDependencies(Dependency dependency) {
        ArrayList childDependencies = new ArrayList();
        for (Iterator repositoryIterator = repositories.iterator(); repositoryIterator.hasNext();) {
            Repository repository = (Repository) repositoryIterator.next();
            if (repository.contains(dependency.getArtifact())) {
                // get the child artifacts
                LinkedHashSet childArtifacts = repository.getDependencies(dependency.getArtifact());
                for (Iterator artifactIterator = childArtifacts.iterator(); artifactIterator.hasNext();) {
                    Artifact artifact = (Artifact) artifactIterator.next();
                    // add each child as a classes-only dependency
                    childDependencies.add(new Dependency(artifact,  ImportType.CLASSES));
                }
View Full Code Here

        this.type = type;
    }

    public void execute() throws MissingDependencyException, IOException {
        Artifact configId = new Artifact(groupId, artifactId, version, type);
        Repository sourceRepository = new Maven1Repository(sourceRepositoryFile);
        WriteableRepository targetRepository = new Maven2Repository(targetRepositoryFile);
        if (!sourceRepository.contains(configId)) {
            throw new MissingDependencyException("source repository at " + sourceRepositoryFile + " does not contain artifact " + configId);
        }
        if (!targetRepository.contains(configId)) {
            File sourceFile = sourceRepository.getLocation(configId);
            targetRepository.copyToRepository(sourceFile, configId, BaseConfigInstaller.LOG_COPY_START);
        }
    }
View Full Code Here

        File path = new File(basedir, "src/test-resources/deployables/" + warName);
        File dest = new File(basedir, "target/test-resources/deployables/" + warName + "/war");
        recursiveCopy(path, dest);
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        AbstractName jaccBeanName = kernel.getNaming().createChildName(moduleName, "foo", NameFactory.JACC_MANAGER);
        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
View Full Code Here

        return new ConfigurationResolver(configurationId, artifactResolver, repositories, childBaseDir, configurationStore, moduleName);
    }

    public File resolve(Artifact artifact) throws MissingDependencyException {
        for (Iterator j = repositories.iterator(); j.hasNext();) {
            Repository repository = (Repository) j.next();
            if (repository.contains(artifact)) {
                File file = repository.getLocation(artifact);
                return file;
            }
        }
        throw new MissingDependencyException("Unable to resolve dependency " + artifact);
    }
View Full Code Here

    }

    private ArrayList getChildDependencies(Dependency dependency) {
        ArrayList childDependencies = new ArrayList();
        for (Iterator repositoryIterator = repositories.iterator(); repositoryIterator.hasNext();) {
            Repository repository = (Repository) repositoryIterator.next();
            if (repository.contains(dependency.getArtifact())) {
                // get the child artifacts
                LinkedHashSet childArtifacts = repository.getDependencies(dependency.getArtifact());
                for (Iterator artifactIterator = childArtifacts.iterator(); artifactIterator.hasNext();) {
                    Artifact artifact = (Artifact) artifactIterator.next();
                    // add each child as a classes-only dependency
                    childDependencies.add(new Dependency(artifact,  ImportType.CLASSES));
                }
View Full Code Here

        outputPath.mkdirs();
        new File(outputPath, "war").mkdir();
        File path = new File(BASEDIR, "src/test/resources/deployables/war4");
        UnpackedJarFile jarFile = new UnpackedJarFile(path);
        Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        module.setEarContext(earContext);
        module.setRootEarContext(earContext);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.repository.Repository

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.