Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 862A3BC7B for ; Fri, 6 Jan 2012 02:39:43 +0000 (UTC) Received: (qmail 82358 invoked by uid 500); 6 Jan 2012 02:39:43 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 82274 invoked by uid 500); 6 Jan 2012 02:39:43 -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 82184 invoked by uid 99); 6 Jan 2012 02:39:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2012 02:39:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 06 Jan 2012 02:39:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F2B3D23889E1; Fri, 6 Jan 2012 02:39:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1227942 - in /geronimo/server/trunk: framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ framework/configs/j2ee-system/src/main/plan/ framework/modules/geronimo-deployment/src/main/java/org... Date: Fri, 06 Jan 2012 02:39:18 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120106023918.F2B3D23889E1@eris.apache.org> Author: djencks Date: Fri Jan 6 02:39:17 2012 New Revision: 1227942 URL: http://svn.apache.org/viewvc?rev=1227942&view=rev Log: GERONIMO-6251 determine if server is actually fully started, provide access to DependencyManager for osgi metadata purposes Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java (with props) geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java (with props) geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java (with props) Modified: geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/HighVersionFirstExportPackagesSelector.java geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiBuildContext.java geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java Modified: geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java (original) +++ geronimo/server/trunk/framework/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java Fri Jan 6 02:39:17 2012 @@ -123,7 +123,7 @@ public class ServerProxy } public boolean isFullyStarted() { - boolean fullyStarted = true; + boolean fullyStarted = false; try { AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName()); @@ -132,8 +132,8 @@ public class ServerProxy while (iter.hasNext()) { AbstractName name = (AbstractName)iter.next(); boolean started = getBooleanAttribute(name, "kernelFullyStarted"); - if (!started) { - fullyStarted = false; + if (started) { + fullyStarted = true; break; } } Modified: geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml (original) +++ geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml Fri Jan 6 02:39:17 2012 @@ -45,6 +45,9 @@ specific services - those should be prov + + + Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/HighVersionFirstExportPackagesSelector.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/HighVersionFirstExportPackagesSelector.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/HighVersionFirstExportPackagesSelector.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/HighVersionFirstExportPackagesSelector.java Fri Jan 6 02:39:17 2012 @@ -25,7 +25,7 @@ import java.util.Set; import org.apache.geronimo.kernel.repository.Artifact; import org.apache.geronimo.kernel.repository.Dependency; -import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.xbean.osgi.bundle.util.BundleDescription.ExportPackage; import org.osgi.framework.Bundle; import org.osgi.framework.Version; @@ -43,14 +43,14 @@ public class HighVersionFirstExportPacka public Map> select(OSGiBuildContext context) { Map> bundleIdExportPackages = new HashMap>(); Map packageNameVersionMap = new HashMap(); - DependencyManager dependencyManager = context.getDependencyManager(); + OsgiMetaDataProvider osgiMetaDataProvider = context.getOsgiMetaDataProvider(); for (Dependency dependency : context.getEnvironment().getDependencies()) { Artifact resolvedArtifact = context.resolveArtifact(dependency.getArtifact()); if(resolvedArtifact == null) { logger.warn("Dependency " + dependency.getArtifact() + " could not be resolved, its export packages are ignored"); continue; } - Bundle dependentBundle = dependencyManager.getBundle(resolvedArtifact); + Bundle dependentBundle = osgiMetaDataProvider.getBundle(resolvedArtifact); if (dependentBundle == null) { logger.warn("Fail to resolve the bundle corresponding to the artifact " + dependency.getArtifact() + ", its export packages are ignored"); continue; Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiBuildContext.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiBuildContext.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiBuildContext.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiBuildContext.java Fri Jan 6 02:39:17 2012 @@ -29,7 +29,7 @@ import org.apache.geronimo.kernel.reposi import org.apache.geronimo.kernel.repository.ArtifactResolver; import org.apache.geronimo.kernel.repository.Environment; import org.apache.geronimo.kernel.repository.MissingDependencyException; -import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.geronimo.system.plugin.model.DependencyType; import org.apache.geronimo.system.plugin.model.PluginArtifactType; import org.apache.xbean.osgi.bundle.util.BundleDescription.ExportPackage; @@ -48,7 +48,7 @@ public class OSGiBuildContext { private Set hiddenImportPackageNames; - private DependencyManager dependencyManager; + private OsgiMetaDataProvider osgiMetaDataProvider; private Environment environment; @@ -58,11 +58,11 @@ public class OSGiBuildContext { private ArtifactResolver clientArtifactResolver; - public OSGiBuildContext(Environment environment, List hiddenImportPackageNamePrefixes, Set hiddenImportPackageNames, DependencyManager dependencyManager, + public OSGiBuildContext(Environment environment, List hiddenImportPackageNamePrefixes, Set hiddenImportPackageNames, OsgiMetaDataProvider dependencyManager, boolean inverseClassLoading) { this.hiddenImportPackageNamePrefixes = hiddenImportPackageNamePrefixes; this.hiddenImportPackageNames = hiddenImportPackageNames; - this.dependencyManager = dependencyManager; + this.osgiMetaDataProvider = dependencyManager; this.environment = environment; this.inverseClassLoading = inverseClassLoading; } @@ -94,8 +94,8 @@ public class OSGiBuildContext { return false; } - public DependencyManager getDependencyManager() { - return dependencyManager; + public OsgiMetaDataProvider getOsgiMetaDataProvider() { + return osgiMetaDataProvider; } public Environment getEnvironment() { @@ -103,7 +103,7 @@ public class OSGiBuildContext { } public Set getEffectExportPackages(Long bundleId) { - Set exportPackages = new HashSet(dependencyManager.getExportedPackages(bundleId)); + Set exportPackages = new HashSet(osgiMetaDataProvider.getExportedPackages(bundleId)); for (Iterator it = exportPackages.iterator(); it.hasNext();) { ExportPackage exportPackage = it.next(); if (isHiddenExportPackage(exportPackage) || exportPackage.getDirectives().get("mandatory") != null) { @@ -129,11 +129,11 @@ public class OSGiBuildContext { if (clientModule) { return getFullClientDependentBundleIds(bundle.getBundleId()); } - return dependencyManager.getFullDependentBundleIds(bundle); + return osgiMetaDataProvider.getFullDependentBundleIds(bundle); } private Set getFullClientDependentBundleIds(long bundleId) { - Artifact artifact = dependencyManager.getArtifact(bundleId); + Artifact artifact = osgiMetaDataProvider.getArtifact(bundleId); if (artifact == null) { return Collections.emptySet(); } @@ -151,11 +151,11 @@ public class OSGiBuildContext { if (resolvedClientArtifact == null) { return; } - Bundle resolvedBundle = dependencyManager.getBundle(resolvedClientArtifact); + Bundle resolvedBundle = osgiMetaDataProvider.getBundle(resolvedClientArtifact); if (resolvedBundle == null || dependentBundleIds.contains(resolvedBundle.getBundleId())) { return; } - PluginArtifactType pluginArtifact = dependencyManager.getCachedPluginMetadata(resolvedBundle); + PluginArtifactType pluginArtifact = osgiMetaDataProvider.getCachedPluginMetadata(resolvedBundle); if (pluginArtifact != null) { for (DependencyType dependency : pluginArtifact.getDependency()) { Artifact resolvedDependentArtifact = resolveArtifact(dependency.toArtifact()); Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/osgi/OSGiMetaDataBuilder.java Fri Jan 6 02:39:17 2012 @@ -30,6 +30,7 @@ import org.apache.geronimo.kernel.Kernel import org.apache.geronimo.kernel.repository.ArtifactResolver; import org.apache.geronimo.kernel.repository.Environment; import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.xbean.osgi.bundle.util.BundleDescription.ExportPackage; import org.apache.xbean.osgi.bundle.util.HeaderParser; import org.apache.xbean.osgi.bundle.util.HeaderParser.HeaderElement; @@ -72,12 +73,12 @@ public class OSGiMetaDataBuilder { processClassloadingRules(environment); ServiceReference serviceReference = null; try { - serviceReference = bundleContext.getServiceReference(DependencyManager.class.getName()); - DependencyManager dependencyManager = null; + serviceReference = bundleContext.getServiceReference(OsgiMetaDataProvider.class.getName()); + OsgiMetaDataProvider osgiMetaDataProvider = null; if (serviceReference != null) { - dependencyManager = (DependencyManager) bundleContext.getService(serviceReference); + osgiMetaDataProvider = (OsgiMetaDataProvider) bundleContext.getService(serviceReference); } - OSGiBuildContext context = createOSGiBuildContext(environment, dependencyManager, clientModule); + OSGiBuildContext context = createOSGiBuildContext(environment, osgiMetaDataProvider, clientModule); processImportPackages(context); } finally { if (serviceReference != null) { @@ -97,7 +98,7 @@ public class OSGiMetaDataBuilder { }*/ } - protected OSGiBuildContext createOSGiBuildContext(Environment environment, DependencyManager dependencyManager, boolean clientModule) throws IllegalConfigurationException { + protected OSGiBuildContext createOSGiBuildContext(Environment environment, OsgiMetaDataProvider osgiMetaDataProvider, boolean clientModule) throws IllegalConfigurationException { List hiddenImportPackageNamePrefixes = new ArrayList(); Set hiddenImportPackageNames = new HashSet(); @@ -168,7 +169,7 @@ public class OSGiMetaDataBuilder { } environment.removeDynamicImportPackages(removedDynamicImportPackages); - OSGiBuildContext osgiBuildContext = new OSGiBuildContext(environment, hiddenImportPackageNamePrefixes, hiddenImportPackageNames, dependencyManager, environment.getClassLoadingRules() + OSGiBuildContext osgiBuildContext = new OSGiBuildContext(environment, hiddenImportPackageNamePrefixes, hiddenImportPackageNames, osgiMetaDataProvider, environment.getClassLoadingRules() .isInverseClassLoading()); osgiBuildContext.setClientModule(clientModule); if (clientModule) { Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Fri Jan 6 02:39:17 2012 @@ -47,6 +47,7 @@ import org.apache.geronimo.kernel.reposi import org.apache.geronimo.kernel.repository.Environment; import org.apache.geronimo.kernel.repository.Repository; import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.geronimo.testsupport.TestSupport; import org.apache.xbean.osgi.bundle.util.BundleDescription.ExportPackage; import org.osgi.framework.Bundle; @@ -96,7 +97,7 @@ public class SingleFileHotDeployerTest e } bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, Collections.singletonMap(baseLocation, NEW_ID)); ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager()); - bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); + bundleContext.registerService(OsgiMetaDataProvider.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); File someFile = new File(dir, "someFile"); someFile.createNewFile(); Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java?rev=1227942&view=auto ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java (added) +++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java Fri Jan 6 02:39:17 2012 @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.geronimo.kernel.config; + +import java.io.IOException; +import java.util.List; + +import org.apache.geronimo.gbean.annotation.GBean; +import org.apache.geronimo.gbean.annotation.ParamSpecial; +import org.apache.geronimo.gbean.annotation.SpecialAttributeType; +import org.apache.geronimo.gbean.wrapper.AbstractServiceWrapper; +import org.apache.geronimo.kernel.repository.Artifact; +import org.osgi.framework.Bundle; + +/** + * @version $Rev:$ $Date:$ + */ +@GBean +public class PersistentConfigurationListGBean extends AbstractServiceWrapper implements PersistentConfigurationList { + public PersistentConfigurationListGBean(@ParamSpecial(type = SpecialAttributeType.bundle)final Bundle bundle) { + super(bundle, PersistentConfigurationList.class); + } + + @Override + public boolean isKernelFullyStarted() { + return get().isKernelFullyStarted(); + } + + @Override + public void setKernelFullyStarted(boolean kernelFullyStarted) { + get().setKernelFullyStarted(kernelFullyStarted); + } + + @Override + public void save() throws IOException { + get().save(); + } + + @Override + public List restore() throws IOException { + return get().restore(); + } + + @Override + public void addConfiguration(Artifact configName) { + get().addConfiguration(configName); + } + + @Override + public void startConfiguration(Artifact configName) { + get().startConfiguration(configName); + } + + @Override + public void stopConfiguration(Artifact configName) { + get().stopConfiguration(configName); + } + + @Override + public void removeConfiguration(Artifact configName) { + get().removeConfiguration(configName); + } + + @Override + public Artifact[] getListedConfigurations(Artifact query) { + return get().getListedConfigurations(query); + } + + @Override + public void migrateConfiguration(Artifact oldName, Artifact newName, Configuration configuration) { + get().migrateConfiguration(oldName, newName, configuration); + } + + @Override + public boolean hasGBeanAttributes(Artifact configName) { + return get().hasGBeanAttributes(configName); + } +} Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationListGBean.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java?rev=1227942&view=auto ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java (added) +++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java Fri Jan 6 02:39:17 2012 @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.geronimo.kernel.repository; + +import java.util.Set; +import java.util.SortedSet; + +import org.apache.geronimo.gbean.annotation.GBean; +import org.apache.geronimo.gbean.annotation.ParamSpecial; +import org.apache.geronimo.gbean.annotation.SpecialAttributeType; +import org.apache.geronimo.gbean.wrapper.AbstractServiceWrapper; +import org.osgi.framework.Bundle; + +/** + * @version $Rev:$ $Date:$ + */ +@GBean(j2eeType = "ArtifactManager") +public class ArtifactManagerGBean extends AbstractServiceWrapper implements ArtifactManager { + public ArtifactManagerGBean(@ParamSpecial(type = SpecialAttributeType.bundle)final Bundle bundle) { + super(bundle, ArtifactManager.class); + } + + @Override + public void loadArtifacts(Artifact artifact, Set artifacts) { + get().loadArtifacts(artifact, artifacts); + } + + @Override + public void unloadAllArtifacts(Artifact artifact) { + get().unloadAllArtifacts(artifact); + } + + @Override + public SortedSet getLoadedArtifacts(Artifact query) { + return get().getLoadedArtifacts(query); + } +} Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ArtifactManagerGBean.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java (original) +++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java Fri Jan 6 02:39:17 2012 @@ -44,6 +44,7 @@ import org.apache.felix.scr.annotations. import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; import org.apache.felix.scr.annotations.ReferencePolicy; +import org.apache.felix.scr.annotations.Service; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.kernel.GBeanNotFoundException; import org.apache.geronimo.kernel.InternalKernelException; @@ -84,8 +85,9 @@ import org.slf4j.LoggerFactory; /** * @version $Rev$ $Date$ */ -@Component -public class DependencyManager { +@Component(immediate = true) +@Service //for OsgiMetaDataBuilder +public class DependencyManager implements OsgiMetaDataProvider { private static final Logger log = LoggerFactory.getLogger(DependencyManager.class); @@ -253,10 +255,12 @@ public class DependencyManager { } } + @Override public Set getExportedPackages(Bundle bundle) { return getExportedPackages(bundle.getBundleId()); } + @Override public Set getExportedPackages(Long bundleId) { synchronized (bundleExportPackagesMap) { Set exportPackages = bundleExportPackagesMap.get(bundleId); @@ -307,6 +311,7 @@ public class DependencyManager { return dependentBundles; } + @Override public Set getFullDependentBundleIds(Bundle bundle) { return getFullDependentBundleIds(bundle.getBundleId()); } @@ -316,6 +321,7 @@ public class DependencyManager { return fullDependentBundleIds == null ? Collections. emptySet() : new HashSet(fullDependentBundleIds); } + @Override public Bundle getBundle(Artifact artifact) { if (!artifact.isResolved()) { try { @@ -328,6 +334,7 @@ public class DependencyManager { return artifactBundleMap.get(artifact); } + @Override public Artifact getArtifact(long bundleId) { return bundleIdArtifactMap.get(bundleId); } @@ -549,6 +556,7 @@ public class DependencyManager { } } + @Override public PluginArtifactType getCachedPluginMetadata(Bundle bundle) { PluginArtifactType pluginArtifactType = pluginMap.get(bundle.getBundleId()); if (pluginArtifactType == null) { Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java?rev=1227942&view=auto ============================================================================== --- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java (added) +++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java Fri Jan 6 02:39:17 2012 @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.geronimo.system.configuration; + +import java.util.Set; + +import org.apache.geronimo.kernel.repository.Artifact; +import org.apache.geronimo.system.plugin.model.PluginArtifactType; +import org.apache.xbean.osgi.bundle.util.BundleDescription; +import org.osgi.framework.Bundle; + +/** + * @version $Rev:$ $Date:$ + */ +public interface OsgiMetaDataProvider { + Set getExportedPackages(Bundle bundle); + + Set getExportedPackages(Long bundleId); + + Set getFullDependentBundleIds(Bundle bundle); + + Bundle getBundle(Artifact artifact); + + Artifact getArtifact(long bundleId); + + PluginArtifactType getCachedPluginMetadata(Bundle bundle); +} Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/OsgiMetaDataProvider.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml (original) +++ geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml Fri Jan 6 02:39:17 2012 @@ -131,6 +131,8 @@ 4201 + + ArtifactManager Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original) +++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Fri Jan 6 02:39:17 2012 @@ -78,6 +78,7 @@ import org.apache.geronimo.kernel.reposi import org.apache.geronimo.kernel.util.FileUtils; import org.apache.geronimo.kernel.util.JarUtils; import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.geronimo.system.serverinfo.BasicServerInfo; import org.apache.geronimo.testsupport.TestSupport; import org.apache.geronimo.transaction.wrapper.manager.GeronimoTransactionManagerGBean; @@ -670,7 +671,7 @@ public class ConnectorModuleBuilderTest } }; bundleContext.registerService(PackageAdmin.class.getName(), packageAdmin, null); - bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); + bundleContext.registerService(OsgiMetaDataProvider.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); kernel = KernelFactory.newInstance(bundleContext).createKernel("test"); kernel.boot(bundleContext); Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java?rev=1227942&r1=1227941&r2=1227942&view=diff ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java (original) +++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java Fri Jan 6 02:39:17 2012 @@ -53,6 +53,7 @@ import org.apache.geronimo.kernel.reposi import org.apache.geronimo.kernel.repository.Repository; import org.apache.geronimo.kernel.util.FileUtils; import org.apache.geronimo.system.configuration.DependencyManager; +import org.apache.geronimo.system.configuration.OsgiMetaDataProvider; import org.apache.geronimo.testsupport.TestSupport; import org.apache.xbean.osgi.bundle.util.BundleDescription.ExportPackage; import org.osgi.framework.Bundle; @@ -147,7 +148,7 @@ public abstract class EARConfigBuilderTe super.setUp(); bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap(), locations); ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager()); - bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); + bundleContext.registerService(OsgiMetaDataProvider.class.getName(), new MockDependencyManager(bundleContext, Collections. emptyList(), null), new Hashtable()); Set repo = new HashSet(); repo.add(Artifact.create("org.apache.geronimo.tests/test/1/car")); repository = new MockRepository(repo);