Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 52232 invoked from network); 20 Sep 2009 21:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Sep 2009 21:49:50 -0000 Received: (qmail 37733 invoked by uid 500); 20 Sep 2009 21:49:49 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 37676 invoked by uid 500); 20 Sep 2009 21:49:49 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 37667 invoked by uid 99); 20 Sep 2009 21:49:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Sep 2009 21:49:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Sep 2009 21:49:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B0DCE23888E7; Sun, 20 Sep 2009 21:49:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r817108 [2/2] - in /geronimo/sandbox/djencks/osgi/framework: ./ buildsupport/car-maven-plugin/ buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ configs/geronimo-boilerplate/src/main/assembly/ configs/geronim... Date: Sun, 20 Sep 2009 21:49:14 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090920214915.B0DCE23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java Sun Sep 20 21:49:12 2009 @@ -19,6 +19,10 @@ import java.io.File; import java.io.IOException; +import java.io.FileWriter; +import java.io.PrintWriter; +import java.io.OutputStream; +import java.io.FileOutputStream; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; @@ -34,10 +38,11 @@ import java.util.StringTokenizer; import java.util.jar.Attributes; import java.util.jar.JarFile; -import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import javax.xml.bind.JAXBException; +import javax.xml.stream.XMLStreamException; import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; @@ -59,10 +64,17 @@ import org.apache.geronimo.kernel.repository.Repository; import org.apache.geronimo.kernel.repository.ClassLoadingRules; import org.apache.geronimo.kernel.repository.Dependency; +import org.apache.geronimo.system.plugin.model.PluginType; +import org.apache.geronimo.system.plugin.model.PluginArtifactType; +import org.apache.geronimo.system.plugin.model.ArtifactType; +import org.apache.geronimo.system.plugin.model.DependencyType; +import org.apache.geronimo.system.plugin.model.PluginXmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; +import org.osgi.framework.Constants; +import org.osgi.framework.BundleException; /** * @version $Rev:385232 $ $Date$ @@ -111,7 +123,8 @@ //This provides services such as loading more bundles, it is NOT for the configuration we are constructing here. //It should be a disposable nested framework so as to not pollute the main framework with stuff we load as deployment parents. private final BundleContext bundleContext; - + //this is the temporary bundle we set up for this deployment + private Bundle bundle; private Configuration configuration; @@ -165,30 +178,36 @@ LinkedHashSet resolvedParentIds = null; try { ConfigurationData configurationData = new ConfigurationData(moduleType, classPath, null, childConfigurationDatas, environment, baseDir, inPlaceConfigurationDir, naming); - ConfigurationResolver configurationResolver = configurationManager.newConfigurationResolver(configurationData); - List urls = new ArrayList(); - for (String path: classPath) { - urls.addAll(configurationResolver.resolve(path)); - } - List parents = new ArrayList(); - resolvedParentIds = configurationManager.resolveParentIds(configurationData); - for (Artifact artifact: resolvedParentIds) { - configurationManager.loadConfiguration(artifact); - Bundle bundle = configurationManager.getBundle(artifact); - if (bundle.getSymbolicName() != null) { - parents.add(bundle); - } - } -// URL[] urls = new URL[0];//TODO crib code from ConfigurationResolver -// Bundle[] parents = new Bundle[] {bundleContext.getBundle()}; //TODO this is the "no parents" case, normally use ConfigurationManager to turn parent artifactIds into bundles - ClassLoadingRules classLoadingRules = new ClassLoadingRules(); - BundleContext bundleContext = new DeploymentBundleContext(this.bundleContext, - baseDir.getAbsolutePath(), - environment.getConfigId(), - urls.toArray(new URL[urls.size()]), - parents.toArray(new Bundle[parents.size()]), - classLoadingRules); - configurationData.setBundleContext(bundleContext); +// ConfigurationResolver configurationResolver = configurationManager.newConfigurationResolver(configurationData); +// List urls = new ArrayList(); +// for (String path: classPath) { +// urls.addAll(configurationResolver.resolve(path)); +// } +// List parents = new ArrayList(); +// resolvedParentIds = configurationManager.resolveParentIds(configurationData); +// for (Artifact artifact: resolvedParentIds) { +// configurationManager.loadConfiguration(artifact); +// Bundle bundle = configurationManager.getBundle(artifact); +// if (bundle.getSymbolicName() != null) { +// parents.add(bundle); +// } +// } +//// URL[] urls = new URL[0];//TODO crib code from ConfigurationResolver +//// Bundle[] parents = new Bundle[] {bundleContext.getBundle()}; //TODO this is the "no parents" case, normally use ConfigurationManager to turn parent artifactIds into bundles +// ClassLoadingRules classLoadingRules = new ClassLoadingRules(); +// BundleContext bundleContext = new DeploymentBundleContext(this.bundleContext, +// baseDir.getAbsolutePath(), +// environment.getConfigId(), +// urls.toArray(new URL[urls.size()]), +// parents.toArray(new Bundle[parents.size()]), +// classLoadingRules); + + createTempManifest(); + createTempPluginMetadata(); + String location = "reference:file:" + baseDir.getAbsolutePath(); + Bundle bundle = this.bundleContext.installBundle(location); + bundle.start(); + configurationData.setBundleContext(bundle.getBundleContext()); configurationManager.loadConfiguration(configurationData); return configurationManager.getConfiguration(environment.getConfigId()); } catch (Exception e) { @@ -196,6 +215,62 @@ } } + private void createTempPluginMetadata() throws IOException, JAXBException, XMLStreamException { + PluginType pluginType = new PluginType(); + pluginType.setName("Temporary Plugin metadata for deployment"); + PluginArtifactType instance = new PluginArtifactType(); + instance.setModuleId(ArtifactType.newArtifactType(environment.getConfigId())); + List dependenciees = instance.getDependency(); + for (Dependency dependency: environment.getDependencies()) { + dependenciees.add(DependencyType.newDependencyType(dependency)); + } + pluginType.getPluginArtifact().add(instance); + File metaInf = new File(baseDir, "META-INF"); + metaInf.mkdirs(); + OutputStream out = new FileOutputStream(new File(metaInf, "geronimo-plugin.xml")); + try { + PluginXmlUtil.writePluginMetadata(pluginType, out); + } finally { + out.close(); + } + } + + private void createTempManifest() throws DeploymentException, IOException { + Manifest manifest = new Manifest(); + manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, getBundleSymbolicName())); + manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, "0.0.0.0")); + manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_CLASSPATH, getBundleClassPath())); + manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.DYNAMICIMPORT_PACKAGE, "*")); + File metaInf = new File(baseDir, "META-INF"); + metaInf.mkdirs(); + FileWriter fw = new FileWriter(new File(metaInf, "manifest.mf")); + PrintWriter pw = new PrintWriter(fw); + try { + manifest.write(pw); + } finally { + pw.close(); + fw.close(); + } + } + + private String getBundleClassPath() { + if (classPath.isEmpty()) { + return "."; + } + StringBuilder buf = new StringBuilder(); + String sep = ""; + for (String path: classPath) { + buf.append(sep).append(path); + sep = ","; + } + return buf.toString(); + } + + private String getBundleSymbolicName() { + Artifact id = environment.getConfigId(); + return id.getGroupId() + "." + id.getArtifactId() + "-DEPLOYMENT"; + } + public ConfigurationManager getConfigurationManager() { return configurationManager; } @@ -360,7 +435,7 @@ } public String getManifestClassPath(JarFile jarFile) throws IOException { - Manifest manifest = jarFile.getManifest(); + java.util.jar.Manifest manifest = jarFile.getManifest(); if (manifest == null) { return null; } @@ -678,6 +753,14 @@ //ignore } } + if (bundle != null) { + try { + bundle.uninstall(); + } catch (BundleException e) { + throw new DeploymentException("Could not uninstall temporary bundle for " + environment.getConfigId(), e); + } + bundle = null; + } } public void addChildConfiguration(String moduleName, ConfigurationData configurationData) { Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Manifest.java (from r816862, ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/Manifest.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Manifest.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Manifest.java&p1=ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/Manifest.java&r1=816862&r2=817108&rev=817108&view=diff ============================================================================== --- ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/Manifest.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Manifest.java Sun Sep 20 21:49:12 2009 @@ -16,7 +16,7 @@ * */ -package org.apache.tools.ant.taskdefs; +package org.apache.geronimo.deployment; import java.io.BufferedReader; import java.io.IOException; @@ -29,10 +29,12 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.util.FileUtils; + +import org.apache.geronimo.common.DeploymentException; /** + * From ant + * * Holds the data of a jar manifest. * * Manifests are processed according to the @@ -413,7 +415,7 @@ * @throws IOException if the section cannot be read from the reader. */ public String read(BufferedReader reader) - throws ManifestException, IOException { + throws ManifestException, IOException, DeploymentException { Attribute attribute = null; while (true) { String line = reader.readLine(); @@ -573,10 +575,10 @@ * @exception ManifestException if the attribute is not valid. */ public void addConfiguredAttribute(Attribute attribute) - throws ManifestException { + throws ManifestException, DeploymentException { String check = addAttributeAndCheck(attribute); if (check != null) { - throw new BuildException("Specify the section name using " + throw new DeploymentException("Specify the section name using " + "the \"name\" attribute of the
element rather " + "than using a \"Name\" manifest attribute"); } @@ -594,9 +596,9 @@ * exists in this section. */ public String addAttributeAndCheck(Attribute attribute) - throws ManifestException { + throws ManifestException, DeploymentException { if (attribute.getName() == null || attribute.getValue() == null) { - throw new BuildException("Attributes must have name and value"); + throw new DeploymentException("Attributes must have name and value"); } if (attribute.getKey().equalsIgnoreCase(ATTRIBUTE_NAME)) { warnings.addElement("\"" + ATTRIBUTE_NAME + "\" attributes " @@ -729,17 +731,17 @@ * Construct a manifest from Ant's default manifest file. * * @return the default manifest. - * @exception BuildException if there is a problem loading the + * @exception DeploymentException if there is a problem loading the * default manifest */ - public static Manifest getDefaultManifest() throws BuildException { + public static Manifest getDefaultManifest() throws DeploymentException { InputStream in = null; InputStreamReader insr = null; try { String defManifest = "/org/apache/tools/ant/defaultManifest.mf"; in = Manifest.class.getResourceAsStream(defManifest); if (in == null) { - throw new BuildException("Could not find default manifest: " + throw new DeploymentException("Could not find default manifest: " + defManifest); } try { @@ -755,12 +757,32 @@ return new Manifest(insr); } } catch (ManifestException e) { - throw new BuildException("Default manifest is invalid !!", e); + throw new DeploymentException("Default manifest is invalid !!", e); } catch (IOException e) { - throw new BuildException("Unable to read default manifest", e); + throw new DeploymentException("Unable to read default manifest", e); } finally { - FileUtils.close(insr); - FileUtils.close(in); + close(insr); + close(in); + } + } + + private static void close(InputStreamReader in) { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + //ignore + } + } + } + + private static void close(InputStream in) { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + //ignore + } } } @@ -778,7 +800,7 @@ * to the JAR spec * @throws IOException if the manifest cannot be read from the reader. */ - public Manifest(Reader r) throws ManifestException, IOException { + public Manifest(Reader r) throws ManifestException, IOException, DeploymentException { BufferedReader reader = new BufferedReader(r); // This should be the manifest version String nextSectionName = mainSection.read(reader); @@ -827,10 +849,10 @@ * @exception ManifestException if the secti0on is not valid. */ public void addConfiguredSection(Section section) - throws ManifestException { + throws ManifestException, DeploymentException { String sectionName = section.getName(); if (sectionName == null) { - throw new BuildException("Sections must have a name"); + throw new DeploymentException("Sections must have a name"); } sections.put(sectionName, section); if (!sectionIndex.contains(sectionName)) { @@ -846,9 +868,9 @@ * @exception ManifestException if the attribute is not valid. */ public void addConfiguredAttribute(Attribute attribute) - throws ManifestException { + throws ManifestException, DeploymentException { if (attribute.getKey() == null || attribute.getValue() == null) { - throw new BuildException("Attributes must have name and value"); + throw new DeploymentException("Attributes must have name and value"); } if (attribute.getKey().equalsIgnoreCase(ATTRIBUTE_MANIFEST_VERSION)) { manifestVersion = attribute.getValue(); @@ -865,7 +887,7 @@ * @throws ManifestException if there is a problem merging the * manifest according to the Manifest spec. */ - public void merge(Manifest other) throws ManifestException { + public void merge(Manifest other) throws ManifestException, DeploymentException { merge(other, false); } @@ -880,7 +902,7 @@ * manifest according to the Manifest spec. */ public void merge(Manifest other, boolean overwriteMain) - throws ManifestException { + throws ManifestException, DeploymentException { if (other != null) { if (overwriteMain) { mainSection = (Section) other.mainSection.clone(); @@ -916,7 +938,7 @@ * * @throws IOException if the manifest cannot be written */ - public void write(PrintWriter writer) throws IOException { + public void write(PrintWriter writer) throws IOException, DeploymentException { writer.print(ATTRIBUTE_MANIFEST_VERSION + ": " + manifestVersion + EOL); String signatureVersion = mainSection.getAttributeValue(ATTRIBUTE_SIGNATURE_VERSION); @@ -958,6 +980,8 @@ write(new PrintWriter(sw)); } catch (IOException e) { return null; + } catch (DeploymentException e) { + return null; } return sw.toString(); } Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ManifestException.java (from r816862, ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/ManifestException.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ManifestException.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ManifestException.java&p1=ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/ManifestException.java&r1=816862&r2=817108&rev=817108&view=diff ============================================================================== --- ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/ManifestException.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ManifestException.java Sun Sep 20 21:49:12 2009 @@ -15,14 +15,18 @@ * limitations under the License. * */ -package org.apache.tools.ant.taskdefs; +package org.apache.geronimo.deployment; + +import org.apache.geronimo.common.DeploymentException; /** + * + * From ant * Exception thrown indicating problems in a JAR Manifest * * @since Ant 1.4 */ -public class ManifestException extends Exception { +public class ManifestException extends DeploymentException { private static final long serialVersionUID = 7685634200457515207L; Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Sun Sep 20 21:49:12 2009 @@ -81,11 +81,11 @@ protected void setUp() throws Exception { super.setUp(); - bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, null); - dir = new File(BASEDIR, "target/deployTest"); dir.mkdirs(); + bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, Collections.singletonMap(dir.getAbsolutePath().substring(1), NEW_ID)); + ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager()); File someFile = new File(dir, "someFile"); someFile.createNewFile(); Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/MultiGBeanInfoFactory.java Sun Sep 20 21:49:12 2009 @@ -56,7 +56,7 @@ errors.add(e); } } - throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + clazz + "], errors: " + errors); + throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + clazz + "], errors: " + errors, errors.get(errors.size() - 1)); } public GBeanInfo getGBeanInfo(String className, Bundle bundle) throws GBeanInfoFactoryException { @@ -68,7 +68,7 @@ errors.add(e); } } - throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + className + "], errors: " + errors); + throw new GBeanInfoFactoryException("Cannot create a GBeanInfo for [" + className + "], errors: " + errors, errors.get(errors.size() - 1)); } } \ No newline at end of file Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/annotation/AnnotationGBeanInfoBuilder.java Sun Sep 20 21:49:12 2009 @@ -25,6 +25,7 @@ import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.lang.reflect.WildcardType; import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -211,7 +212,17 @@ if (Collection.class.isAssignableFrom(parameterType)) { if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) genericType; - return (Class) parameterizedType.getActualTypeArguments()[0]; + Type componentType = parameterizedType.getActualTypeArguments()[0]; + if (componentType instanceof Class) { + return (Class) componentType; + } + if (componentType instanceof WildcardType) { + Type[] upper = ((WildcardType)componentType).getUpperBounds(); + if (upper.length == 1 && upper[0] instanceof Class) { + return (Class) upper[0]; + } + } + throw new GBeanAnnotationException("Generic type is not a class: " + componentType); } else { throw new GBeanAnnotationException(Collection.class + " parameter must be generified"); } Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Sun Sep 20 21:49:12 2009 @@ -82,8 +82,8 @@ this(stores, artifactResolver, repositories, Collections.emptySet(), bundleContext); } - public SimpleConfigurationManager(@ParamReference(name = "ConfigurationStore") Collection stores, - @ParamReference(name = "ArtifactResolver") ArtifactResolver artifactResolver, + public SimpleConfigurationManager(@ParamReference(name = "Stores") Collection stores, + @ParamReference(name = "ArtifactResolver", namingType = "ArtifactResolver") ArtifactResolver artifactResolver, @ParamReference(name = "Repositories") Collection repositories, @ParamReference(name = "Watchers") Collection watchers, @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) { @@ -339,32 +339,31 @@ if (actuallyLoaded == null) { actuallyLoaded = new LinkedHashMap(resolvedParents.size()); } -// Artifact configurationId = null; try { - for (Artifact configurationId : resolvedParents) { - - monitor.loading(configurationId); - String bundleId = null; - bundleId = locateBundle(configurationId, monitor); - Bundle parent = bundleContext.installBundle(bundleId); - if (parent.getSymbolicName() != null) { - try { - parent.start(); - bundles.put(configurationId, parent); - } catch (BundleException e) { - log.info("failed to start bundle: " + parent, e); - } - } -// Configuration configuration = load(unloadedConfiguration.getConfigurationData(), unloadedConfiguration.getResolvedParentIds(), actuallyLoaded); - monitor.succeeded(configurationId); - - } +// for (Artifact configurationId : resolvedParents) { +// +// monitor.loading(configurationId); +// String bundleId = locateBundle(configurationId, monitor); +// try { +// Bundle parent = bundleContext.installBundle(bundleId); +// if (parent.getSymbolicName() != null) { +// try { +// parent.start(); +// bundles.put(configurationId, parent); +// } catch (BundleException e) { +// log.info("failed to start bundle: " + parent, e); +// } +// } +// } catch (BundleException e) { +// log.info("failed to install bundle " + configurationId + ", message: " + e.getMessage()); +// } +// monitor.succeeded(configurationId); +// +// } // update the status of the loaded configurations Configuration configuration = load(configurationData, resolvedParents, actuallyLoaded); actuallyLoaded.put(configurationData.getId(), configuration); - configurations.put(configurationData.getId(), configuration); addNewConfigurationToModel(configuration); -// results.setLoaded(actuallyLoaded.keySet()); } catch (Exception e) { // monitor.failed(configurationId, e); @@ -385,7 +384,6 @@ loadedConfigurations.remove(); } } - } load(id); monitor.finished(); @@ -633,7 +631,7 @@ monitor.reading(configurationId); for (Repository repo : repositories) { if (repo.contains(configurationId)) { - return "file://" + repo.getLocation(configurationId).getAbsolutePath(); + return "reference:file://" + repo.getLocation(configurationId).getAbsolutePath(); } } NoSuchConfigException exception = new NoSuchConfigException(configurationId); Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java Sun Sep 20 21:49:12 2009 @@ -742,6 +742,8 @@ bundleContext); bundleContext.setConfigurationManager(configurationManager); + configurationManager.loadConfiguration(artifact1); + configurationManager.loadConfiguration(artifact2); } protected void tearDown() throws Exception { Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java Sun Sep 20 21:49:12 2009 @@ -24,12 +24,14 @@ import java.io.IOException; import java.util.Dictionary; import java.util.Enumeration; +import java.util.Map; import java.net.URL; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; import org.osgi.framework.ServiceReference; import org.osgi.framework.BundleContext; +import org.osgi.framework.Version; /** * @version $Rev$ $Date$ @@ -136,6 +138,14 @@ return bundleContext; } + public Map getSignerCertificates(int signersType) { + return null; + } + + public Version getVersion() { + return null; + } + public void setBundleContext(BundleContext bundleContext) { this.bundleContext = bundleContext; } Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundleContext.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundleContext.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundleContext.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundleContext.java Sun Sep 20 21:49:12 2009 @@ -89,8 +89,14 @@ } public Bundle installBundle(String location) throws BundleException { - if (location.startsWith("file://")) { - location = location.substring("file://".length()); + if (location.startsWith("reference:")) { + location = location.substring("reference:".length()); + } + if (location.startsWith("file:")) { + location = location.substring("file:".length()); + } + while (location.startsWith("/")) { + location = location.substring(1); } MockBundle bundle = new MockBundle(classLoader, location, counter++); bundles.put(counter, bundle); Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java (from r815988, geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanRootSupport.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java&p1=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanRootSupport.java&r1=815988&r2=817108&rev=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanRootSupport.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java Sun Sep 20 21:49:12 2009 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.geronimo.deployment.plugin; +package org.apache.geronimo.deployment.dconfigbean; import javax.enterprise.deploy.model.DDBeanRoot; import javax.enterprise.deploy.spi.DConfigBean; Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanRootSupport.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java (from r815988, geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanSupport.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java&p1=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanSupport.java&r1=815988&r2=817108&rev=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DConfigBeanSupport.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java Sun Sep 20 21:49:12 2009 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.geronimo.deployment.plugin; +package org.apache.geronimo.deployment.dconfigbean; import javax.enterprise.deploy.model.DDBean; import javax.enterprise.deploy.model.XpathEvent; Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DConfigBeanSupport.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java (from r815988, geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DeploymentConfigurationSupport.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java&p1=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DeploymentConfigurationSupport.java&r1=815988&r2=817108&rev=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/DeploymentConfigurationSupport.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java Sun Sep 20 21:49:12 2009 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.geronimo.deployment.plugin; +package org.apache.geronimo.deployment.dconfigbean; import java.io.OutputStream; import java.io.InputStream; Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/DeploymentConfigurationSupport.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Copied: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java (from r815988, geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java) URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java?p2=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java&p1=geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java&r1=815988&r2=817108&rev=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/XmlBeanSupport.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java Sun Sep 20 21:49:12 2009 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.geronimo.deployment.plugin; +package org.apache.geronimo.deployment.dconfigbean; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/dconfigbean/XmlBeanSupport.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/Artifact.java Sun Sep 20 21:49:12 2009 @@ -16,7 +16,7 @@ */ package org.apache.geronimo.deployment.service.jsr88; -import org.apache.geronimo.deployment.plugin.XmlBeanSupport; +import org.apache.geronimo.deployment.dconfigbean.XmlBeanSupport; import org.apache.geronimo.deployment.xbeans.ArtifactType; import org.apache.xmlbeans.SchemaTypeLoader; import org.apache.xmlbeans.XmlBeans; Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/EnvironmentData.java Sun Sep 20 21:49:12 2009 @@ -19,7 +19,7 @@ import java.util.Set; import java.util.HashSet; import java.util.Iterator; -import org.apache.geronimo.deployment.plugin.XmlBeanSupport; +import org.apache.geronimo.deployment.dconfigbean.XmlBeanSupport; import org.apache.geronimo.deployment.xbeans.DependenciesType; import org.apache.geronimo.deployment.xbeans.EnvironmentType; import org.apache.geronimo.deployment.xbeans.ArtifactType; Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java Sun Sep 20 21:49:12 2009 @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.List; import java.util.Collection; +import java.util.ArrayList; import javax.xml.bind.JAXBException; import javax.xml.stream.XMLStreamException; @@ -42,11 +43,14 @@ import org.apache.geronimo.kernel.config.NoSuchConfigException; import org.apache.geronimo.kernel.config.InvalidConfigException; import org.xml.sax.SAXException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @version $Rev$ $Date$ */ public class DependencyManager implements SynchronousBundleListener { + private static final Logger log = LoggerFactory.getLogger(DependencyManager.class); private final BundleContext bundleContext; private final Collection repositories; @@ -66,31 +70,33 @@ private void installed(Bundle bundle) { URL info = bundle.getEntry("META-INF/geronimo-plugin.xml"); if (info != null) { - System.out.println("found geronimo-plugin.xml for bundle " + bundle); + log.info("found geronimo-plugin.xml for bundle " + bundle); try { InputStream in = info.openStream(); try { PluginType pluginType = PluginXmlUtil.loadPluginMetadata(in); PluginArtifactType pluginArtifactType = pluginType.getPluginArtifact().get(0); List dependencies = pluginArtifactType.getDependency(); + List bundles = new ArrayList(); for (DependencyType dependencyType: dependencies) { - System.out.println("installing artifact: " + dependencyType); + log.info("installing artifact: " + dependencyType); Artifact artifact = dependencyType.toArtifact(); String location = locateBundle(artifact); - bundleContext.installBundle(location); + try { + bundles.add(bundleContext.installBundle(location)); + } catch (BundleException e) { + log.warn("Could not install bundle for artifact: " + artifact, e); + } } - } catch (JAXBException e) { - - } catch (SAXException e) { - - } catch (XMLStreamException e) { - - } catch (InvalidConfigException e) { - - } catch (NoSuchConfigException e) { - - } catch (BundleException e) { - + for (Bundle b: bundles) { + try { + b.start(); + } catch (BundleException e) { + log.warn("Could not start bundle: " + b, e); + } + } + } catch (Exception e) { + log.warn("Could not read geronimo metadata for bundle: " + bundle, e); } finally { in.close(); } @@ -98,7 +104,7 @@ //?? } } else { - System.out.println("did not find geronimo-plugin.xml for bundle " + bundle); + log.info("did not find geronimo-plugin.xml for bundle " + bundle); } } Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ArtifactType.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ArtifactType.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ArtifactType.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ArtifactType.java Sun Sep 20 21:49:12 2009 @@ -215,4 +215,14 @@ return new Artifact(groupId, artifactId, version, type); } + public static ArtifactType newArtifactType(Artifact artifact) { + ArtifactType artifactType = new ArtifactType(); + artifactType.setGroupId(artifact.getGroupId()); + artifactType.setArtifactId(artifact.getArtifactId()); + if (artifact.getVersion() != null) { + artifactType.setVersion(artifact.getVersion().toString()); + } + artifactType.setType(artifact.getType()); + return artifactType; + } } Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/DependencyType.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/DependencyType.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/DependencyType.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/DependencyType.java Sun Sep 20 21:49:12 2009 @@ -16,6 +16,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import org.apache.geronimo.kernel.repository.Dependency; /** @@ -169,4 +170,16 @@ public String toString() { return "DependencyType [" + getGroupId() + "/" + getArtifactId() + "/" + getVersion() + "/" + getType() + ":" + getImport() + "]"; } + + public static DependencyType newDependencyType(Dependency dependency) { + DependencyType dependencyType = new DependencyType(); + dependencyType.setGroupId(dependency.getArtifact().getGroupId()); + dependencyType.setArtifactId(dependency.getArtifact().getArtifactId()); + if (dependency.getArtifact().getVersion() != null) { + dependencyType.setVersion(dependency.getArtifact().getVersion().toString()); + } + dependencyType.setType(dependency.getArtifact().getType()); + dependencyType.setImport(ImportType.fromValue(dependency.getImportType().getName())); + return dependencyType; + } } Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ImportType.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ImportType.java?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ImportType.java (original) +++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ImportType.java Sun Sep 20 21:49:12 2009 @@ -53,7 +53,7 @@ return c; } } - throw new IllegalArgumentException(v.toString()); + throw new IllegalArgumentException(v); } } Modified: geronimo/sandbox/djencks/osgi/framework/plugingroups/framework/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/plugingroups/framework/src/main/history/dependencies.xml?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/plugingroups/framework/src/main/history/dependencies.xml (original) +++ geronimo/sandbox/djencks/osgi/framework/plugingroups/framework/src/main/history/dependencies.xml Sun Sep 20 21:49:12 2009 @@ -3,11 +3,16 @@ org.apache.geronimo.framework.plugingroups framework - 2.2-SNAPSHOT + 3.0-SNAPSHOT car org.apache.geronimo.framework + client-system + car + + + org.apache.geronimo.framework geronimo-boilerplate car @@ -28,17 +33,17 @@ org.apache.geronimo.framework - j2ee-system + j2ee-security car org.apache.geronimo.framework - client-system + j2ee-system car org.apache.geronimo.framework - rmi-naming + jsr88-cli car @@ -48,7 +53,7 @@ org.apache.geronimo.framework - j2ee-security + rmi-naming car @@ -61,9 +66,4 @@ shutdown car - - org.apache.geronimo.framework - jsr88-cli - car - Modified: geronimo/sandbox/djencks/osgi/framework/pom.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/pom.xml?rev=817108&r1=817107&r2=817108&view=diff ============================================================================== --- geronimo/sandbox/djencks/osgi/framework/pom.xml (original) +++ geronimo/sandbox/djencks/osgi/framework/pom.xml Sun Sep 20 21:49:12 2009 @@ -38,7 +38,27 @@ org.apache.felix org.osgi.core - 1.2.0 + 1.5.0-SNAPSHOT + + + org.apache.felix + org.apache.felix.configadmin + 1.0.10 + + + org.apache.felix + org.osgi.compendium + 1.5.0-SNAPSHOT + + + org.apache.felix + org.osgi.foundation + + + org.apache.felix + javax.servlet + + org.ops4j.pax.exam @@ -82,11 +102,6 @@ - org.apache.felix - org.apache.felix.configadmin - 1.0.10 - - org.ops4j.pax.logging pax-logging-api 1.3.0 @@ -111,6 +126,14 @@ pax-url-mvn 1.0.0 + + + + org.apache.geronimo.components + geronimo-jaspi + 1.1-SNAPSHOT + + org.apache.geronimo.bundles @@ -160,6 +183,13 @@ + + org.apache.maven + maven-core + 2.0.9 + + +