Package org.apache.geronimo.kernel.repository

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


     *
     * @return The resulting prerequisite, if any.
     */
    private PluginMetadata.Prerequisite processDependencyList(List real, PluginMetadata.Prerequisite prereq, List deps) {
        for (int i = 0; i < real.size(); i++) {
            Dependency dep = (Dependency) real.get(i);
            if ((dep.getArtifact().getGroupId() != null) && (dep.getArtifact().getGroupId().equals("geronimo"))) {
                if(dep.getArtifact().getArtifactId().indexOf("jetty") > -1) {
                    if(prereq == null) {
                        prereq = new PluginMetadata.Prerequisite(dep.getArtifact(), true, "Web Container", "This plugin works with the Geronimo/Jetty distribution.  It is not intended to run in the Geronimo/Tomcat distribution.  There is a separate version of this plugin that works with Tomcat.");
                    }
                    continue;
                } else if(dep.getArtifact().getArtifactId().indexOf("tomcat") > -1) {
                    if(prereq == null) {
                        prereq = new PluginMetadata.Prerequisite(dep.getArtifact(), true, "Web Container", "This plugin works with the Geronimo/Tomcat distribution.  It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version of this plugin that works with Jetty.");
                    }
                    continue;
                }
            }
            if(!deps.contains(dep.getArtifact().toString().trim())) {
                deps.add(dep.getArtifact().toString().trim());
            }
        }
        return prereq;
    }
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

    }

    private static List toDependencyTypes(Collection artifacts) {
        List dependencies = new ArrayList();
        for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
            Dependency dependency = (Dependency) iterator.next();
            ArtifactType artifactType = toDependencyType(dependency);
            dependencies.add(artifactType);
        }
        return dependencies;
    }
View Full Code Here

    private static LinkedHashSet toDependencies(DependencyType[] dependencyArray) {
        LinkedHashSet dependencies = new LinkedHashSet();
        for (int i = 0; i < dependencyArray.length; i++) {
            DependencyType artifactType = dependencyArray[i];
            Dependency dependency = toDependency(artifactType);
            dependencies.add(dependency);
        }
        return dependencies;
    }
View Full Code Here

    }

    private static Dependency toDependency(DependencyType dependencyType) {
        Artifact artifact = toArtifact(dependencyType, null);
        if (ImportType.CLASSES.equals(dependencyType.getImport())) {
            return new Dependency(artifact, org.apache.geronimo.kernel.repository.ImportType.CLASSES);
        } else if (ImportType.SERVICES.equals(dependencyType.getImport())) {
            return new Dependency(artifact, org.apache.geronimo.kernel.repository.ImportType.SERVICES);
        } else if (dependencyType.getImport() == null) {
            return new Dependency(artifact, org.apache.geronimo.kernel.repository.ImportType.ALL);
        } else {
            throw new IllegalArgumentException("Unknown import type: " + dependencyType.getImport());
        }
    }
View Full Code Here

            Environment env = config.getEnvironment();
            LinkedHashSet deps = new LinkedHashSet();

            Iterator iter = env.getDependencies().iterator();
            while (iter.hasNext()) {
                Dependency dep = (Dependency) iter.next();
                deps.add(dep.getArtifact());
            }

            installDependencies(deps);
        }
        catch (IOException e) {
View Full Code Here

                .getParameter(DESTINATION_MODULE_NAME);
        try {

            Artifact configId = new Artifact(Artifact.DEFAULT_GROUP_ID, BASE_CONFIG_URI + destinationName, "0", "car");
            ConfigurationData configurationData = new ConfigurationData(configId, kernel.getNaming());
            configurationData.getEnvironment().addDependency(new Dependency(ACTIVEMQ_ARTIFACT, ImportType.ALL));

            AbstractName adminObjectName = kernel.getNaming().createRootName(configId, destinationName, NameFactory.JCA_ADMIN_OBJECT);
//            ObjectName adminObjectName = NameFactory.getComponentName(null,
//                    null, destinationApplicationName, NameFactory.JCA_RESOURCE,
//                    destinationModuleName, destinationName, null, baseContext);
View Full Code Here

        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

                // 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));
                }
            }
        }
        return childDependencies;
    }
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.