Package org.apache.geronimo.kernel.repository

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


        // Download and install the dependencies
        try {
            if (!configID.isResolved()) {
                // See if something's running
                for (int i = matches.length - 1; i >= 0; i--) {
                    Artifact match = matches[i];
                    if (configStore.containsConfiguration(match) && configManager.isRunning(match)) {
                        log.debug("Found required configuration=" + match + " and it is running.");
                        return; // its dependencies must be OK
                    } else {
                        log.debug("Either required configuration=" + match + " is not installed or it is not running.");
                    }
                }
                // Go with something that's installed
                configID = matches[matches.length - 1];
            }
            ConfigurationData data = null;
            if (configStore.containsConfiguration(configID)) {
                if (configManager.isRunning(configID)) {
                    return; // its dependencies must be OK
                }
                log.debug("Loading configuration=" + configID);
                data = configStore.loadConfiguration(configID);
            }
            // Download the dependencies
            parentStack.push(configID);
            if (instance == null) {
                //no plugin metadata, guess with something else
                Dependency[] dependencies = data == null ? getDependencies(writeableRepo, configID) : getDependencies(data);
                for (Dependency dep : dependencies) {
                    Artifact artifact = dep.getArtifact();
                    log.debug("Attempting to download dependency=" + artifact + " for configuration=" + configID);
                    downloadArtifact(artifact, metadata, repos, username, password, monitor, soFar, parentStack, true, servers, loadOverride);
                }
            } else {
                //rely on plugin metadata if present.
                List<DependencyType> deps = instance.getDependency();
                for (DependencyType dep : deps) {
                    Artifact artifact = toArtifact(dep);
                    log.debug("Attempting to download dependency=" + artifact + " for configuration=" + configID);
                    downloadArtifact(artifact, metadata, repos, username, password, monitor, soFar, parentStack, true, servers, loadOverride & dep.isStart());
                }
            }
            parentStack.pop();
View Full Code Here


        meta.getPluginArtifact().add(instance);
        meta.setName(toArtifactType(moduleId).toString());
        instance.setModuleId(toArtifactType(moduleId));
        meta.setCategory("Unknown");
        instance.getGeronimoVersion().add(serverInfo.getVersion());
        instance.getObsoletes().add(toArtifactType(new Artifact(moduleId.getGroupId(),
                moduleId.getArtifactId(),
                (Version) null,
                moduleId.getType())));
        List<DependencyType> deps = instance.getDependency();
        addGeronimoDependencies(data, deps, true);
View Full Code Here

            }
        }
    }

    public static DependencyType toDependencyType(Dependency dep, boolean includeVersion) {
        Artifact id = dep.getArtifact();
        DependencyType dependency = new DependencyType();
        dependency.setGroupId(id.getGroupId());
        dependency.setArtifactId(id.getArtifactId());
        if (includeVersion) {
            dependency.setVersion(id.getVersion() == null ? null : id.getVersion().toString());
        }
        dependency.setType(id.getType());
        return dependency;
    }
View Full Code Here

        if (version.length() == 0) version = null;

        String type = (String) artifactParts.get(3);
        if (type.length() == 0) type = null;

        artifact = new Artifact(groupId, artifactId, version, type);

        //
        // name map
        //
        name = new TreeMap();
View Full Code Here

    public static Artifact toArtifact(ArtifactType moduleId) {
        String groupId = moduleId.getGroupId();
        String artifactId = moduleId.getArtifactId();
        String version = moduleId.getVersion();
        String type = moduleId.getType();
        return new Artifact(groupId, artifactId, version, type);
    }
View Full Code Here

    }
   
    public File[] getClasspath(Collection<? extends Repository> repositories) throws DeploymentException {
        ArrayList<File> jars = new ArrayList<File>();
        for (String[] lib : LIBS) {
            Artifact artifact = new Artifact(lib[0], lib[1], (Version)null, "jar");
            jars.add(getLocation(repositories, artifact));
        }
        if (this.saajImpl != null) {
            jars.add(getLocation(repositories, this.saajImpl));
        }
View Full Code Here

        builder.addGBeans(earContext, module, cl, Collections.EMPTY_SET);
        ConfigurationData configurationData = earContext.getConfigurationData();
        earContext.close();
        module.close();

        Artifact configurationId = configurationData.getId();
        configurationManager.loadConfiguration(configurationData);
        Configuration configuration = configurationManager.getConfiguration(configurationId);
        configurationManager.startConfiguration(configurationId);

        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(moduleName));
View Full Code Here

        builder.addGBeans(earContext, module, cl, Collections.EMPTY_SET);
        ConfigurationData configurationData = earContext.getConfigurationData();
        earContext.close();
        module.close();

        Artifact configurationId = configurationData.getId();
        configurationManager.loadConfiguration(configurationData);
        Configuration configuration = configurationManager.getConfiguration(configurationId);
        configurationManager.startConfiguration(configurationId);

        String contextRoot = (String) kernel.getAttribute(moduleName, "contextPath");
View Full Code Here

        storeA = (ConfigurationStore) mock(ConfigurationStore.class);
        storeB = (ConfigurationStore) mock(ConfigurationStore.class);
       
        stores = new ArrayList<ConfigurationStore>();
       
        artifact = new Artifact("groupId", "artifactId", "2.0", "car");

        storeA.getAbstractName();
        nameA = new AbstractName(artifact, Collections.singletonMap("name", "A"));
        modify().multiplicity(expect.from(0)).returnValue(nameA);
       
View Full Code Here

            if (version.length() == 0) version = null;

            String type = (String) artifactParts.get(3);
            if (type.length() == 0) type = null;

            artifact = new Artifact(groupId, artifactId, version, type);
        } else {
            artifact = null;
        }

        //
View Full Code Here

TOP

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

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.