Package org.apache.geronimo.kernel.repository

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


        Environment environment = configurationData.getEnvironment();

        LinkedHashSet<Artifact> parentIds = new LinkedHashSet<Artifact>();
        List<Dependency> dependencies = new ArrayList<Dependency>(environment.getDependencies());
        for (ListIterator<Dependency> iterator = dependencies.listIterator(); iterator.hasNext();) {
            Dependency dependency = iterator.next();
            Artifact resolvedArtifact = artifactResolver.resolveInClassLoader(dependency.getArtifact());
            if (isConfiguration(resolvedArtifact)) {
                parentIds.add(resolvedArtifact);

                // update the dependency list to contain the resolved artifact
                dependency = new Dependency(resolvedArtifact, dependency.getImportType());
                iterator.set(dependency);
            } else if (dependency.getImportType() == ImportType.SERVICES) {
                // Service depdendencies require that the depdencency be a configuration
                throw new InvalidConfigException("Dependency does not have services: " + resolvedArtifact);
            }
        }
View Full Code Here


        return reloadConfiguration(existingUnloadedConfiguration, configurationData, monitor);
    }

    private boolean hasHardDependency(Artifact configurationId, ConfigurationData configurationData) {
        for (Iterator iterator = configurationData.getEnvironment().getDependencies().iterator(); iterator.hasNext();) {
            Dependency dependency = (Dependency) iterator.next();
            Artifact artifact = dependency.getArtifact();
            if (artifact.getVersion() != null && artifact.matches(configurationId)) {
                return true;
            }
        }
View Full Code Here

        ArrayList<Dependency> missingPrereqs = new ArrayList<Dependency>();
        for (PrerequisiteType prereq : prereqs) {
            Artifact artifact = toArtifact(prereq.getId());
            try {
                if (getServerInstance("default", servers).getArtifactResolver().queryArtifacts(artifact).length == 0) {
                    missingPrereqs.add(new Dependency(artifact, ImportType.ALL));
                }
            } catch (NoServerInstanceException e) {
                throw new RuntimeException("Invalid setup, no default server instance registered");
            }
        }
View Full Code Here

    private static Dependency[] getDependencies(Repository repo, Artifact artifact) {
        Set<Artifact> set = repo.getDependencies(artifact);
        Dependency[] results = new Dependency[set.size()];
        int index = 0;
        for (Artifact dep : set) {
            results[index] = new Dependency(dep, ImportType.CLASSES);
            ++index;
        }
        return results;
    }
View Full Code Here

    }
    private void toDependencies(List<String> artifacts, List<DependencyType> result) {
        result.clear();
        for (String artifact : artifacts) {
            //TODO this is wrong.... need to encode import type as well
            result.add(PluginInstallerGBean.toDependencyType(new Dependency(Artifact.create(artifact), ImportType.ALL), true));
        }
    }
View Full Code Here

        target.setName("Sample Application");
        target.setCategory("Samples");
        target.setDescription("A sample application");
        PluginArtifactType instance = new PluginArtifactType();
        target.getPluginArtifact().add(instance);
        instance.getDependency().add(PluginInstallerGBean.toDependencyType(new Dependency(Artifact.create(moduleIdName), ImportType.ALL), true));
        PluginListType list = new PluginListType();
        list.getPlugin().add(target);
//        list.getDefaultRepository().add(repo.toString());
        //todo this is surely wrong
        list.getDefaultRepository().add("http://www.ibiblio.org/maven2/");
View Full Code Here

        return false;
    }

    protected boolean matchesDefaultEnvironment(Environment environment) {
        for (Iterator iterator = defaultEnvironment.getDependencies().iterator(); iterator.hasNext();) {
            Dependency defaultDependency = (Dependency) iterator.next();
            boolean matches = false;
            for (Iterator iterator1 = environment.getDependencies().iterator(); iterator1.hasNext();) {
                Dependency actualDependency = (Dependency) iterator1.next();
                if (matches(defaultDependency, actualDependency)) {
                    matches = true;
                    break;
                }
            }
View Full Code Here

        ArrayList<Dependency> missingPrereqs = new ArrayList<Dependency>();
        for (PrerequisiteType prereq : prereqs) {
            Artifact artifact = toArtifact(prereq.getId());
            try {
                if (getServerInstance("default", servers).getArtifactResolver().queryArtifacts(artifact).length == 0) {
                    missingPrereqs.add(new Dependency(artifact, ImportType.ALL));
                }
            } catch (NoServerInstanceException e) {
                throw new RuntimeException("Invalid setup, no default server instance registered");
            }
        }
View Full Code Here

    private static Dependency[] getDependencies(Repository repo, Artifact artifact) {
        Set<Artifact> set = repo.getDependencies(artifact);
        Dependency[] results = new Dependency[set.size()];
        int index = 0;
        for (Artifact dep : set) {
            results[index] = new Dependency(dep, ImportType.CLASSES);
            ++index;
        }
        return results;
    }
View Full Code Here

        ArrayList<Dependency> missingPrereqs = new ArrayList<Dependency>();
        for (PrerequisiteType prereq : prereqs) {
            Artifact artifact = toArtifact(prereq.getId());
            try {
                if (getServerInstance("default", servers).getArtifactResolver().queryArtifacts(artifact).length == 0) {
                    missingPrereqs.add(new Dependency(artifact, ImportType.ALL));
                }
            } catch (NoServerInstanceException e) {
                throw new RuntimeException("Invalid setup, no default server instance registered");
            }
        }
View Full Code Here

TOP

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

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.