geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1221390 [4/8] - in /geronimo/server/trunk: ./ framework/buildsupport/car-maven-plugin/ framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ framework/buildsupport/car-maven-plugin/src/main/resources/M...
Date Tue, 20 Dec 2011 18:05:05 GMT
Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java?rev=1221390&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java Tue Dec 20 18:04:59 2011
@@ -0,0 +1,133 @@
+/*
+ * 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.command;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.commands.Option;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.management.State;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+@Command(scope = "gbeans", name = "list", description = "Lists all gbeans in the kernel.")
+public class ListGBeansCommand extends KernelCommandSupport {
+
+    @Option(name = "-q", aliases = {"--query"}, description = "Abstract name query URI", required = false, multiValued = false)
+    String queryString = "";
+
+    @Option(name = "-v", aliases = {"--verbose"}, description = "Show the state reason for non-running gbeans", required = false, multiValued = false)
+    boolean verbose;
+
+    @Override
+    protected void doExecute(Kernel kernel) throws Exception {
+        AbstractNameQuery query = new AbstractNameQuery(URI.create(queryString));
+        List<AbstractName> names = new ArrayList<AbstractName>(kernel.listGBeans(query));
+        if (names.isEmpty()) {
+            System.out.println("No gbeans found in kernel");
+            return;
+        }
+
+        Collections.sort(names, new Comparator<AbstractName> () {
+            @Override
+            public int compare(AbstractName first, AbstractName second) {
+                return first.toString().compareTo(second.toString());
+            }
+        });
+
+        LinkedHashMap<AbstractName, Integer> states = new LinkedHashMap<AbstractName, Integer>();
+
+        for (AbstractName name: names) {
+            states.put(name, kernel.getGBeanState(name));
+        }
+        StringBuilder buf = new StringBuilder("State      Name:\n");
+        for (Map.Entry<AbstractName, Integer> entry: states.entrySet()) {
+            AbstractName name = entry.getKey();
+            int state = entry.getValue();
+            buf.append("[").append(State.fromInt(state)).append("]   ").append(name).append("\n");
+            if (verbose) {
+                if (state == State.FAILED_INDEX) {
+                    buf.append("  state reason: ").append(kernel.getStateReason(name)).append("\n\n");
+                } else if (state != State.RUNNING_INDEX) {
+                    GBeanData data = kernel.getGBeanData(name);
+                    if (!data.getDependencies().isEmpty()) {
+                        buf.append(" non-running dependendencies:\n");
+                        for (ReferencePatterns pattern : data.getDependencies()) {
+                            if (pattern.isResolved()) {
+                                AbstractName dependencyName = pattern.getAbstractName();
+                                if (states.get(dependencyName) != State.RUNNING_INDEX) {
+                                    buf.append("   state: ").append(states.get(dependencyName)).append(" resolved: ").append(dependencyName).append("\n");
+                                }
+                            } else {
+                                Set<AbstractName> choices = kernel.listGBeans(pattern.getPatterns());
+                                if (choices.isEmpty()) {
+                                    buf.append("  unresolved: ").append(pattern).append("\n");
+                                }
+                            }
+                        }
+                    }
+                    if (!data.getReferences().isEmpty()) {
+                        GBeanInfo info = data.getGBeanInfo();
+                        buf.append("  non-running references:\n");
+                        for (Map.Entry<String, ReferencePatterns> refEntry : data.getReferences().entrySet()) {
+                            ReferencePatterns pattern = refEntry.getValue();
+                            GReferenceInfo refInfo = info.getReference(refEntry.getKey());
+                            boolean multivalued = refInfo.getProxyType().equals(Collection.class.getName());
+                            if (!multivalued) {
+                                if (pattern.isResolved()) {
+                                    AbstractName dependencyName = pattern.getAbstractName();
+                                    if (states.get(dependencyName) != State.RUNNING_INDEX) {
+                                        buf.append("   state: [").append(State.fromInt(states.get(dependencyName))).append("] resolved: ").append(dependencyName).append("\n");
+                                    }
+                                } else {
+                                    Set<AbstractName> choices = kernel.listGBeans(pattern.getPatterns());
+                                    if (choices.isEmpty()) {
+                                        buf.append("  unresolved: ").append(pattern).append("\n");
+                                    }
+                                }
+                            }
+                        }
+
+                    }
+                }
+            }
+        }
+
+        System.out.println(buf.toString());
+
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/command/ListGBeansCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java?rev=1221390&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java Tue Dec 20 18:04:59 2011
@@ -0,0 +1,249 @@
+/*
+ * 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.Collection;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+import org.apache.geronimo.gbean.AbstractName;
+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.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.Version;
+import org.osgi.framework.Bundle;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+
+@GBean(j2eeType="ConfigurationManager")
+public class ConfigurationManagerGBean extends AbstractServiceWrapper<ConfigurationManager> implements ConfigurationManager {
+    public ConfigurationManagerGBean(@ParamSpecial(type = SpecialAttributeType.bundle)final Bundle bundle) {
+        super(bundle, ConfigurationManager.class);
+    }
+
+    @Override
+    public boolean isInstalled(Artifact configurationId) {
+        return get().isInstalled(configurationId);
+    }
+
+    @Override
+    public boolean isLoaded(Artifact configurationId) {
+        return get().isLoaded(configurationId);
+    }
+
+    @Override
+    public boolean isRunning(Artifact configurationId) {
+        return get().isRunning(configurationId);
+    }
+
+    @Override
+    public Artifact[] getInstalled(Artifact query) {
+        return get().getInstalled(query);
+    }
+
+    @Override
+    public Artifact[] getLoaded(Artifact query) {
+        return get().getLoaded(query);
+    }
+
+    @Override
+    public Artifact[] getRunning(Artifact query) {
+        return get().getRunning(query);
+    }
+
+    @Override
+    public List listConfigurations() {
+        return get().listConfigurations();
+    }
+
+    @Override
+    public List<AbstractName> listStores() {
+        return get().listStores();
+    }
+
+    @Override
+    public ConfigurationStore[] getStores() {
+        return get().getStores();
+    }
+
+    @Override
+    public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
+        return get().getStoreForConfiguration(configuration);
+    }
+
+    @Override
+    public List listConfigurations(AbstractName store) throws NoSuchStoreException {
+        return get().listConfigurations(store);
+    }
+
+    @Override
+    public boolean isConfiguration(Artifact artifact) {
+        return get().isConfiguration(artifact);
+    }
+
+    @Override
+    public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+        return get().loadConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
+        return get().loadConfiguration(configurationData);
+    }
+
+    @Override
+    public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().loadConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().loadConfiguration(configurationData, monitor);
+    }
+
+    @Override
+    public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+        return get().unloadConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().unloadConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+        return get().startConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().startConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
+        return get().stopConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
+        return get().stopConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+        return get().restartConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().restartConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationId);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationId, monitor);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationId, version);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationId, version, monitor);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationData);
+    }
+
+    @Override
+    public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        return get().reloadConfiguration(configurationData, monitor);
+    }
+
+    @Override
+    public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException, LifecycleException {
+        get().uninstallConfiguration(configurationId);
+    }
+
+    @Override
+    public ArtifactResolver getArtifactResolver() {
+        return get().getArtifactResolver();
+    }
+
+    @Override
+    public boolean isOnline() {
+        return get().isOnline();
+    }
+
+    @Override
+    public void setOnline(boolean online) {
+        get().setOnline(online);
+    }
+
+    @Override
+    public Collection<? extends Repository> getRepositories() {
+        return get().getRepositories();
+    }
+
+    @Override
+    public LinkedHashSet<Artifact> sort(List<Artifact> ids, LifecycleMonitor monitor) throws InvalidConfigException, IOException, NoSuchConfigException, MissingDependencyException {
+        return get().sort(ids, monitor);
+    }
+
+    @Override
+    public ConfigurationResolver newConfigurationResolver(ConfigurationData configurationData) {
+        return get().newConfigurationResolver(configurationData);
+    }
+
+    @Override
+    public LinkedHashSet<Artifact> resolveParentIds(ConfigurationData configurationData) throws MissingDependencyException, InvalidConfigException {
+        return get().resolveParentIds(configurationData);
+    }
+
+    @Override
+    public Bundle getBundle(Artifact id) {
+        return get().getBundle(id);
+    }
+
+    @Override
+    public Configuration getConfiguration(Artifact configurationId) {
+        return get().getConfiguration(configurationId);
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManagerGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStore.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStore.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStore.java Tue Dec 20 18:04:59 2011
@@ -27,6 +27,7 @@ import java.util.Set;
 
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.repository.Repository;
 
 /**
  * Interface to a store for Configurations.

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java?rev=1221390&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java Tue Dec 20 18:04:59 2011
@@ -0,0 +1,103 @@
+/*
+ * 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.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.geronimo.gbean.AbstractName;
+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(j2eeType = "ConfigurationStore")
+public class ConfigurationStoreGBean extends AbstractServiceWrapper<ConfigurationStore> implements ConfigurationStore {
+    public ConfigurationStoreGBean(@ParamSpecial(type = SpecialAttributeType.bundle)final Bundle bundle) {
+        super(bundle, ConfigurationStore.class);
+    }
+
+    @Override
+    public boolean isInPlaceConfiguration(Artifact configId) throws NoSuchConfigException, IOException {
+        return get().isInPlaceConfiguration(configId);
+    }
+
+    @Override
+    public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
+        get().install(configurationData);
+    }
+
+    @Override
+    public void uninstall(Artifact configId) throws NoSuchConfigException, IOException {
+        get().uninstall(configId);
+    }
+
+    @Override
+    public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+        return get().loadConfiguration(configId);
+    }
+
+    @Override
+    public boolean containsConfiguration(Artifact configId) {
+        return get().containsConfiguration(configId);
+    }
+
+    @Override
+    public String getObjectName() {
+        return get().getObjectName();
+    }
+
+    @Override
+    public AbstractName getAbstractName() {
+        return get().getAbstractName();
+    }
+
+    @Override
+    public List<ConfigurationInfo> listConfigurations() {
+        return get().listConfigurations();
+    }
+
+    @Override
+    public File createNewConfigurationDir(Artifact configId) throws ConfigurationAlreadyExistsException {
+        return get().createNewConfigurationDir(configId);
+    }
+
+    @Override
+    public Set<URL> resolve(Artifact configId, String moduleName, String path) throws NoSuchConfigException, MalformedURLException {
+        return get().resolve(configId, moduleName, path);
+    }
+
+    @Override
+    public void exportConfiguration(Artifact configId, OutputStream output) throws IOException, NoSuchConfigException {
+        get().exportConfiguration(configId, output);
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStoreGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Tue Dec 20 18:04:59 2011
@@ -163,20 +163,20 @@ public final class ConfigurationUtil {
         return configurationMarshaler.newGBeanState(gbeans);
     }
 
-    public static AbstractName loadBootstrapConfiguration(Kernel kernel, InputStream in, BundleContext bundleContext) throws Exception {
-        return loadBootstrapConfiguration(kernel, in, bundleContext, false);
+    public static AbstractName loadBootstrapConfiguration(Kernel kernel, InputStream in, BundleContext bundleContext, ConfigurationManager configurationManager) throws Exception {
+        return loadBootstrapConfiguration(kernel, in, bundleContext, false, configurationManager);
     }
 
-    public static AbstractName loadBootstrapConfiguration(Kernel kernel, InputStream in, BundleContext bundleContext, boolean enableBootRepo) throws Exception {
+    public static AbstractName loadBootstrapConfiguration(Kernel kernel, InputStream in, BundleContext bundleContext, boolean enableBootRepo, ConfigurationManager configurationManager) throws Exception {
         ConfigurationData configurationData = readConfigurationData(in);
-        return loadBootstrapConfiguration(kernel, configurationData, bundleContext, enableBootRepo);
+        return loadBootstrapConfiguration(kernel, configurationData, bundleContext, enableBootRepo, configurationManager);
     }
 
-    public static AbstractName loadBootstrapConfiguration(Kernel kernel, ConfigurationData configurationData, BundleContext bundleContext) throws Exception {
-        return loadBootstrapConfiguration(kernel, configurationData, bundleContext, false);
+    public static AbstractName loadBootstrapConfiguration(Kernel kernel, ConfigurationData configurationData, BundleContext bundleContext, ConfigurationManager configurationManager) throws Exception {
+        return loadBootstrapConfiguration(kernel, configurationData, bundleContext, false, configurationManager);
     }
 
-    public static AbstractName loadBootstrapConfiguration(Kernel kernel, ConfigurationData configurationData, BundleContext bundleContext, boolean enableBootRepo) throws Exception {
+    public static AbstractName loadBootstrapConfiguration(Kernel kernel, ConfigurationData configurationData, BundleContext bundleContext, boolean enableBootRepo, ConfigurationManager configurationManager) throws Exception {
         if (kernel == null) throw new NullPointerException("kernel is null");
         if (configurationData == null) throw new NullPointerException("configurationData is null");
         if (bundleContext == null) throw new NullPointerException("bundle is null");
@@ -219,7 +219,7 @@ public final class ConfigurationUtil {
         // start the gbeans
         startConfigurationGBeans(configuration.getAbstractName(), configuration, kernel);
 
-        ConfigurationManager configurationManager = getConfigurationManager(kernel);
+//        ConfigurationManager configurationManager = getConfigurationManager(kernel);
         configurationManager.loadConfiguration(configId);
         return gbeanData.getAbstractName();
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java Tue Dec 20 18:04:59 2011
@@ -26,6 +26,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
@@ -61,18 +67,30 @@ import org.slf4j.LoggerFactory;
  * @version $Rev:386276 $ $Date$
  */
 
-@GBean(j2eeType = "ConfigurationManager")
-@OsgiService
+@Component(inherit = true, immediate = true, metatype = true)
+@Service
 public class KernelConfigurationManager extends SimpleConfigurationManager implements GBeanLifecycle {
 
-    protected final Kernel kernel;
-    protected final ManageableAttributeStore attributeStore;
-    protected final PersistentConfigurationList configurationList;
-    private final ArtifactManager artifactManager;
-    private final ShutdownHook shutdownHook;
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected Kernel kernel;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected ManageableAttributeStore attributeStore;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected PersistentConfigurationList configurationList;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private ArtifactManager artifactManager;
+
+    private ShutdownHook shutdownHook;
+
     private boolean online = true;
 
-    public KernelConfigurationManager(@ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
+    public KernelConfigurationManager() {
+    }
+
+    public KernelConfigurationManager(Kernel kernel,
                                       @ParamReference(name = "Stores", namingType = "ConfigurationStore") Collection<ConfigurationStore> stores,
                                       @ParamReference(name = "AttributeStore", namingType = "AttributeStore") ManageableAttributeStore attributeStore,
                                       @ParamReference(name = "PersistentConfigurationList") PersistentConfigurationList configurationList,
@@ -94,6 +112,49 @@ public class KernelConfigurationManager 
         shutdownHook = new ShutdownHook(kernel, configurationModel);
     }
 
+    public void setArtifactManager(ArtifactManager artifactManager) {
+        this.artifactManager = artifactManager;
+    }
+
+    public void unsetArtifactManager(ArtifactManager artifactManager) {
+        this.artifactManager = null;
+    }
+
+    public void setAttributeStore(ManageableAttributeStore attributeStore) {
+        this.attributeStore = attributeStore;
+    }
+
+    public void unsetAttributeStore(ManageableAttributeStore attributeStore) {
+        this.attributeStore = null;
+    }
+
+    public void setConfigurationList(PersistentConfigurationList configurationList) {
+        this.configurationList = configurationList;
+    }
+
+    public void unsetConfigurationList(PersistentConfigurationList configurationList) {
+        this.configurationList = null;
+    }
+
+    public void setKernel(Kernel kernel) {
+        this.kernel = kernel;
+    }
+    public void unsetKernel(Kernel kernel) {
+        this.kernel = null;
+    }
+
+    @Activate
+    public void activate(BundleContext bundleContext) {
+        super.activate(bundleContext);
+        shutdownHook = new ShutdownHook(kernel, getConfigurationModel());
+        kernel.registerShutdownHook(shutdownHook);
+    }
+
+    @Deactivate
+    public void deactivate() {
+        kernel.unregisterShutdownHook(shutdownHook);
+    }
+
     private static ArtifactResolver createArtifactResolver(ArtifactResolver artifactResolver, ArtifactManager artifactManager, Collection<ListableRepository> repositories) {
         if (artifactResolver != null) {
             return artifactResolver;

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Tue Dec 20 18:04:59 2011
@@ -28,6 +28,12 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.annotation.GBean;
@@ -46,23 +52,36 @@ import org.apache.geronimo.kernel.reposi
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
-@GBean(j2eeType = "ConfigurationManager")
+
+@Component(componentAbstract = true)
 public class SimpleConfigurationManager implements ConfigurationManager {
     protected static final Logger log = LoggerFactory.getLogger(SimpleConfigurationManager.class);
-    protected final Collection<ConfigurationStore> stores;
-    private final ArtifactResolver artifactResolver;
+
+    protected final ConfigurationModel configurationModel;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private ArtifactResolver artifactResolver;
+
+    @Reference(referenceInterface = ConfigurationStore.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    protected final Collection<ConfigurationStore> stores = new LinkedHashSet<ConfigurationStore>();
+
+    @Reference(referenceInterface = Repository.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    protected final Collection<Repository> repositories = new LinkedHashSet<Repository>();
+
+    @Reference(referenceInterface = DeploymentWatcher.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    protected final Collection<DeploymentWatcher> watchers = new LinkedHashSet<DeploymentWatcher>();
+
     protected final Map<Artifact, Configuration> configurations = new LinkedHashMap<Artifact, Configuration>();
     protected final Map<Artifact, Bundle> bundles = new LinkedHashMap<Artifact, Bundle>();
-    protected final ConfigurationModel configurationModel;
-    protected final Collection<? extends Repository> repositories;
-    protected final Collection<DeploymentWatcher> watchers;
-    protected final BundleContext bundleContext;
+
+    protected BundleContext bundleContext;
 
     //TODO need thread local of loaded configurations OSGI GROSS!!
     private final ThreadLocal<Map<Artifact, Configuration>> loadedConfigurations = new ThreadLocal<Map<Artifact, Configuration>>() {
@@ -78,15 +97,19 @@ public class SimpleConfigurationManager 
 
     private Object reloadingConfigurationLock = new Object();
 
+    public SimpleConfigurationManager() {
+        this.configurationModel = new ConfigurationModel();
+    }
+
     public SimpleConfigurationManager(Collection<ConfigurationStore> stores, ArtifactResolver artifactResolver, Collection<? extends Repository> repositories, BundleContext bundleContext) {
         this(stores, artifactResolver, repositories, Collections.<DeploymentWatcher>emptySet(), bundleContext);
     }
 
-    public SimpleConfigurationManager(@ParamReference(name = "Stores", namingType = "ConfigurationStore") Collection<ConfigurationStore> stores,
-                                      @ParamReference(name = "ArtifactResolver", namingType = "ArtifactResolver") ArtifactResolver artifactResolver,
-                                      @ParamReference(name = "Repositories", namingType = "Repository") Collection<? extends Repository> repositories,
-                                      @ParamReference(name = "Watchers") Collection<DeploymentWatcher> watchers,
-                                      @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) {
+    public SimpleConfigurationManager(Collection<ConfigurationStore> stores,
+                                      ArtifactResolver artifactResolver,
+                                      Collection<? extends Repository> repositories,
+                                      Collection<DeploymentWatcher> watchers,
+                                      BundleContext bundleContext) {
         this(stores, artifactResolver, repositories, watchers, bundleContext, new ConfigurationModel());
     }
 
@@ -101,10 +124,50 @@ public class SimpleConfigurationManager 
             if (watcher == null) throw new NullPointerException("null DeploymentWatcher");
         }
         this.configurationModel = configurationModel;
-        this.stores = stores;
+        this.stores.addAll(stores);
         this.artifactResolver = artifactResolver;
-        this.repositories = repositories;
-        this.watchers = watchers;
+        this.repositories.addAll(repositories);
+        this.watchers.addAll(watchers);
+        this.bundleContext = bundleContext;
+    }
+
+
+    public void setArtifactResolver(ArtifactResolver artifactResolver) {
+        this.artifactResolver = artifactResolver;
+    }
+
+    public void unsetArtifactResolver(ArtifactResolver artifactResolver) {
+        if (this.artifactResolver == artifactResolver) {
+            this.artifactResolver = null;
+        }
+    }
+
+    public void bindConfigurationStore(ConfigurationStore configurationStore) {
+        stores.add(configurationStore);
+    }
+
+    public void unbindConfigurationStore(ConfigurationStore configurationStore) {
+        stores.remove(configurationStore);
+    }
+
+    public void bindRepository(Repository repository) {
+        repositories.add(repository);
+    }
+
+    public void unbindRepository(Repository repository) {
+        repositories.remove(repository);
+    }
+
+    public void bindDeploymentWatcher(DeploymentWatcher deploymentWatcher) {
+        watchers.add(deploymentWatcher);
+    }
+
+    public void unbindDeploymentWatcher(DeploymentWatcher deploymentWatcher) {
+        watchers.remove(deploymentWatcher);
+    }
+
+    @Activate
+    public void activate(BundleContext bundleContext) {
         this.bundleContext = bundleContext;
     }
 
@@ -309,6 +372,10 @@ public class SimpleConfigurationManager 
             Bundle bundle = bundleContext.installBundle(location);
             if (BundleUtils.canStart(bundle)) {
                 bundle.start(Bundle.START_TRANSIENT);
+                if (bundle.getState() != 32) {
+//                    throw new IllegalStateException("Cant start bundle " + configurationId);
+                    bundle.start();   //should throw an exception if bundle won't start. start triggers ConfigurationActivator which does most of the load work.
+                }
             }
             bundles.put(configurationId, bundle);
         } catch (Exception e) {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/ConfigurationActivator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/ConfigurationActivator.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/ConfigurationActivator.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/ConfigurationActivator.java Tue Dec 20 18:04:59 2011
@@ -35,25 +35,27 @@ import org.apache.geronimo.kernel.GBeanN
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.gbean.AbstractName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ConfigurationActivator implements BundleActivator {
 
+    private static Logger log = LoggerFactory.getLogger(ConfigurationActivator.class);
     private Artifact id;
 
 
     public void start(BundleContext bundleContext) throws Exception {
-        ServiceReference kernelReference = null;
+        ServiceReference<ConfigurationManager> configurationManagerReference = null;
         InputStream in = null;
         try {
-            kernelReference = bundleContext.getServiceReference(Kernel.class.getName());
-            if (kernelReference == null) {
+            configurationManagerReference = bundleContext.getServiceReference(ConfigurationManager.class);
+            if (configurationManagerReference == null) {
                 return;
             }
-            Kernel kernel = (Kernel) bundleContext.getService(kernelReference);
-            ConfigurationManager manager = ConfigurationUtil.getConfigurationManager(kernel);
+            ConfigurationManager manager = bundleContext.getService(configurationManagerReference);
             Bundle bundle = bundleContext.getBundle();
             in = bundle.getEntry("META-INF/config.ser").openStream();
             //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
@@ -62,15 +64,18 @@ public class ConfigurationActivator impl
             manager.loadConfiguration(data);
             id = data.getId();
             //            manager.startConfiguration(id);
+        } catch (Exception e) {
+            log.warn("Exception trying to load configuration bundle " + bundleContext, e);
+            throw e;
         } finally {
             if (in != null)
                 try {
                     in.close();
                 } catch (Exception e) {
                 }
-            if (kernelReference != null)
+            if (configurationManagerReference != null)
                 try {
-                    bundleContext.ungetService(kernelReference);
+                    bundleContext.ungetService(configurationManagerReference);
                 } catch (Exception e) {
                 }
         }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/KernelActivator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/KernelActivator.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/KernelActivator.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/KernelActivator.java Tue Dec 20 18:04:59 2011
@@ -21,24 +21,14 @@
 package org.apache.geronimo.kernel.osgi;
 
 import java.util.Dictionary;
-import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
 import java.net.URL;
 import java.io.InputStream;
-import java.io.IOException;
 
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.PersistentConfigurationList;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -52,31 +42,31 @@ public class KernelActivator implements 
     private ServiceRegistration kernelRegistration;
 
     public void start(BundleContext bundleContext) throws Exception {
-        Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("geronimo");
-        kernel.boot();
-        Dictionary dictionary = null;//new Hashtable();
-        kernelRegistration = bundleContext.registerService(Kernel.class.getName(), kernel, dictionary);
-        //boot the root configuration
-        Bundle bundle = bundleContext.getBundle();
-        URL plan = bundle.getEntry("META-INF/config.ser");
-        InputStream in = plan.openStream();
-        try {
-            //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
-            ConfigurationData data = ConfigurationUtil.readConfigurationData(in);
-            data.setBundleContext(bundleContext);
-            AbstractName name = ConfigurationUtil.loadBootstrapConfiguration(kernel, data, bundleContext, false);
-//            Artifact id = data.getId();
-//            manager.startConfiguration(id);
-        } finally {
-            in.close();
-        }
+//        Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("geronimo");
+//        kernel.boot(bundleContext);
+//        Dictionary dictionary = null;//new Hashtable();
+//        kernelRegistration = bundleContext.registerService(Kernel.class.getName(), kernel, dictionary);
+//        //boot the root configuration
+//        Bundle bundle = bundleContext.getBundle();
+//        URL plan = bundle.getEntry("META-INF/config.ser");
+//        InputStream in = plan.openStream();
+//        try {
+//            //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
+//            ConfigurationData data = ConfigurationUtil.readConfigurationData(in);
+//            data.setBundleContext(bundleContext);
+//            AbstractName name = ConfigurationUtil.loadBootstrapConfiguration(kernel, data, bundleContext, false, configurationManager);
+////            Artifact id = data.getId();
+////            manager.startConfiguration(id);
+//        } finally {
+//            in.close();
+//        }
 
     }
 
     public void stop(BundleContext bundleContext) throws Exception {
-        Kernel kernel = (Kernel) bundleContext.getService(kernelRegistration.getReference());
-        kernel.shutdown();
-        kernelRegistration.unregister();
-        kernelRegistration = null;
+//        Kernel kernel = (Kernel) bundleContext.getService(kernelRegistration.getReference());
+//        kernel.shutdown();
+//        kernelRegistration.unregister();
+//        kernelRegistration = null;
     }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactManager.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactManager.java Tue Dec 20 18:04:59 2011
@@ -26,12 +26,16 @@ import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 
 /**
  * @version $Rev$ $Date$
  */
+@Component
+@Service
 public class DefaultArtifactManager implements ArtifactManager {
     private final Map<Artifact, Set<Artifact>> artifactsByLoader = new HashMap<Artifact, Set<Artifact>>();
     private final Map<String, List<Artifact>> artifactsByArtifact = new HashMap<String, List<Artifact>>();
@@ -100,15 +104,15 @@ public class DefaultArtifactManager impl
         return results;
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(DefaultArtifactManager.class, "ArtifactManager");
-        infoFactory.addInterface(ArtifactManager.class);
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
+//    public static final GBeanInfo GBEAN_INFO;
+//
+//    static {
+//        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(DefaultArtifactManager.class, "ArtifactManager");
+//        infoFactory.addInterface(ArtifactManager.class);
+//        GBEAN_INFO = infoFactory.getBeanInfo();
+//    }
+//
+//    public static GBeanInfo getGBeanInfo() {
+//        return GBEAN_INFO;
+//    }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactResolver.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactResolver.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/DefaultArtifactResolver.java Tue Dec 20 18:04:59 2011
@@ -24,30 +24,41 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.DependencyNodeUtil;
 
 /**
  * @version $Rev$ $Date$
  */
 
-@GBean(j2eeType = "ArtifactResolver")
+@Component(componentAbstract = true)
 public class DefaultArtifactResolver implements ArtifactResolver {
-    private final ArtifactManager artifactManager;
-    private final Collection<ListableRepository> repositories;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    private ArtifactManager artifactManager;
+
+    @Reference(name = "repository", referenceInterface = ListableRepository.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    private final Collection<ListableRepository> repositories = new LinkedHashSet<ListableRepository>();
+
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policy = ReferencePolicy.DYNAMIC)
+    private ConfigurationManager configurationManager;
+
     private final Map<Artifact, Artifact> explicitResolution = new ConcurrentHashMap<Artifact, Artifact>();
-    private final Collection<ConfigurationManager> configurationManagers;
+
+    public DefaultArtifactResolver() {
+    }
 
     public DefaultArtifactResolver(ArtifactManager artifactManager, ListableRepository repository) {
         this.artifactManager = artifactManager;
-        this.repositories = Collections.singleton(repository);
-        configurationManagers = Collections.emptyList();
+        if (repository != null) {
+            repositories.add(repository);
+        }
     }
 
     public DefaultArtifactResolver(
@@ -56,17 +67,52 @@ public class DefaultArtifactResolver imp
             @ParamAttribute(name="explicitResolution")Map<Artifact, Artifact> explicitResolution,
             @ParamReference(name="ConfigurationManagers", namingType = "ConfigurationManager")Collection<ConfigurationManager> configurationManagers) {
         this.artifactManager = artifactManager;
-        this.repositories = repositories;
+        this.repositories.addAll(repositories);
         if (explicitResolution != null) {
             this.explicitResolution.putAll(explicitResolution);
         }
-        this.configurationManagers = configurationManagers;
+        if (!configurationManagers.isEmpty()) {
+            this.configurationManager = configurationManagers.iterator().next();
+        }
+    }
+
+    public void setArtifactManager(ArtifactManager artifactManager) {
+        this.artifactManager = artifactManager;
+    }
+
+    public void unsetArtifactManager(ArtifactManager artifactManager) {
+        if (this.artifactManager == artifactManager) {
+            this.artifactManager = null;
+        }
+    }
+
+    public void setConfigurationManager(ConfigurationManager configurationManager) {
+        this.configurationManager = configurationManager;
+    }
+
+    public void unsetConfigurationManager(ConfigurationManager configurationManager) {
+        if (this.configurationManager == configurationManager) {
+            this.configurationManager = null;
+        }
+    }
+
+    public void bindRepository(ListableRepository repository) {
+        repositories.add(repository);
+    }
+
+    public void unbindRepository(ListableRepository repository) {
+        repositories.remove(repository);
     }
 
     protected Map<Artifact, Artifact> getExplicitResolution() {
         return explicitResolution;
     }
 
+    protected void activate(Map<Artifact, Artifact> explicitResolution) {
+        this.explicitResolution.putAll(explicitResolution);
+    }
+
+    @Override
     public Artifact generateArtifact(Artifact source, String defaultType) {
         if(source.isResolved()) {
             Artifact deAliased = explicitResolution.get(source);
@@ -83,6 +129,7 @@ public class DefaultArtifactResolver imp
         return new Artifact(groupId, artifactId, version, type);
     }
 
+    @Override
     public Artifact queryArtifact(Artifact artifact) throws MultipleMatchesException {
         Artifact[] all = queryArtifacts(artifact);
         if(all.length > 1) {
@@ -91,6 +138,7 @@ public class DefaultArtifactResolver imp
         return all.length == 0 ? null : all[0];
     }
 
+    @Override
     public Artifact[] queryArtifacts(Artifact artifact) {
         //see if there is an explicit resolution for this artifact.
         Artifact deAliased = explicitResolution.get(artifact);
@@ -104,10 +152,12 @@ public class DefaultArtifactResolver imp
         return set.toArray(new Artifact[set.size()]);
     }
 
+    @Override
     public LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> artifacts) throws MissingDependencyException {
         return resolveInClassLoader(artifacts, Collections.<Configuration>emptySet());
     }
 
+    @Override
     public LinkedHashSet<Artifact> resolveInClassLoader(Collection<Artifact> artifacts, Collection<Configuration> parentConfigurations) throws MissingDependencyException {
         LinkedHashSet<Artifact> resolvedArtifacts = new LinkedHashSet<Artifact>();
         for (Artifact artifact : artifacts) {
@@ -119,10 +169,12 @@ public class DefaultArtifactResolver imp
         return resolvedArtifacts;
     }
 
+    @Override
     public Artifact resolveInClassLoader(Artifact source) throws MissingDependencyException {
         return resolveInClassLoader(source, Collections.<Configuration>emptySet());
     }
 
+    @Override
     public Artifact resolveInClassLoader(Artifact source, Collection<Configuration> parentConfigurations) throws MissingDependencyException {
         Artifact working = resolveVersion(parentConfigurations, source);
         if (working == null || !working.isResolved()) {
@@ -245,10 +297,10 @@ public class DefaultArtifactResolver imp
     }
 
     private Configuration getConfiguration(Artifact parentId) {
-        if (configurationManagers.size() != 1) {
+        if (configurationManager == null) {
             throw new IllegalStateException("no configuration manager");
         }
-        return configurationManagers.iterator().next().getConfiguration(parentId);
+        return configurationManager.getConfiguration(parentId);
     }
 
     private Artifact getArtifactVersion(Collection<Artifact> artifacts, Artifact query) {

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java?rev=1221390&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java Tue Dec 20 18:04:59 2011
@@ -0,0 +1,73 @@
+/*
+ * 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.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+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 = "Repository")
+public class RepositoryGBean extends AbstractServiceWrapper<WritableListableRepository> implements WritableListableRepository {
+    public RepositoryGBean(@ParamSpecial(type = SpecialAttributeType.bundle)final Bundle bundle) {
+        super(bundle, WritableListableRepository.class);
+    }
+
+    @Override
+    public SortedSet<Artifact> list() {
+        return get().list();
+    }
+
+    @Override
+    public SortedSet<Artifact> list(Artifact query) {
+        return get().list(query);
+    }
+
+    @Override
+    public void copyToRepository(File source, Artifact destination, FileWriteMonitor monitor) throws IOException {
+        get().copyToRepository(source, destination, monitor);
+    }
+
+    @Override
+    public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException {
+        get().copyToRepository(source, size, destination, monitor);
+    }
+
+    @Override
+    public boolean contains(Artifact artifact) {
+        return get().contains(artifact);
+    }
+
+    @Override
+    public File getLocation(Artifact artifact) {
+        return get().getLocation(artifact);
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/RepositoryGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java Tue Dec 20 18:04:59 2011
@@ -70,7 +70,7 @@ public class MainConfigurationBootstrapp
     
     public void bootKernel(BundleContext bundleContext) throws Exception {
         kernel = KernelFactory.newInstance(bundleContext).createKernel("MainBootstrapper");
-        kernel.boot();
+        kernel.boot(bundleContext);
 
         Runtime.getRuntime().addShutdownHook(new Thread("MainBootstrapper shutdown thread") {
             public void run() {
@@ -80,18 +80,18 @@ public class MainConfigurationBootstrapp
     }
     
     public void loadBootConfiguration(BundleContext bundleContext) throws Exception {
-        InputStream in = bundleContext.getBundle().getResource("META-INF/config.ser").openStream();
-        try {
-            ConfigurationUtil.loadBootstrapConfiguration(kernel, in, bundleContext, true);
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException ignored) {
-                    // ignored
-                }
-            }
-        }
+//        InputStream in = bundleContext.getBundle().getResource("META-INF/config.ser").openStream();
+//        try {
+//            ConfigurationUtil.loadBootstrapConfiguration(kernel, in, bundleContext, true, configurationManager);
+//        } finally {
+//            if (in != null) {
+//                try {
+//                    in.close();
+//                } catch (IOException ignored) {
+//                    // ignored
+//                }
+//            }
+//        }
     }
     
     public void loadPersistentConfigurations() throws Exception {

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml?rev=1221390&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml (added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml Tue Dec 20 18:04:59 2011
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+        <command name="gbean/list">
+            <action class="org.apache.geronimo.kernel.command.ListGBeansCommand"/>
+        </command>
+    </command-bundle>
+
+
+</blueprint>

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/resources/OSGI-INF/blueprint/kernel-command.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/Speed.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/Speed.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/Speed.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/Speed.java Tue Dec 20 18:04:59 2011
@@ -94,7 +94,7 @@ public class Speed extends TestSupport {
 
         // start a kernel
         Kernel kernel = KernelFactory.newInstance(getBundleContext()).createKernel("speed");
-        kernel.boot();
+        kernel.boot(bundleContext);
         AbstractName abstractName = kernel.getNaming().createRootName(new Artifact("test", "foo", "1", "car"), "test", "test");
         GBeanData mockGBean = new GBeanData(abstractName, MockGBean.getGBeanInfo());
         mockGBean.setAttribute("Name", "bar");
@@ -223,7 +223,7 @@ public class Speed extends TestSupport {
 
         // start a kernel
         Kernel kernel = KernelFactory.newInstance(getBundleContext()).createKernel("speed");
-        kernel.boot();
+        kernel.boot(bundleContext);
         AbstractName abstractName = kernel.getNaming().createRootName(new Artifact("test", "foo", "1", "car"), "test", "test");
         GBeanData mockGBean = new GBeanData(abstractName, MockGBean.getGBeanInfo());
         mockGBean.setAttribute("Name", "bar");

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java Tue Dec 20 18:04:59 2011
@@ -336,7 +336,7 @@ public class GBeanAttributeTest extends 
     protected void setUp() throws Exception {
         super.setUp();
         kernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        kernel.boot();
+        kernel.boot(bundleContext);
 
         AbstractName name = kernel.getNaming().createRootName(new Artifact("test", "foo", "1", "car"), "test", "test");
         gbeanInstance = new GBeanInstance(new GBeanData(name, MockGBean.getGBeanInfo()),

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java Tue Dec 20 18:04:59 2011
@@ -51,7 +51,7 @@ public class GBeanDependencyTest extends
     protected void setUp() throws Exception {
         super.setUp();
         kernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        kernel.boot();
+        kernel.boot(bundleContext);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/BootstrapTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/BootstrapTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/BootstrapTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/BootstrapTest.java Tue Dec 20 18:04:59 2011
@@ -30,12 +30,12 @@ public class BootstrapTest extends TestC
     private File kernelState;
 
     public void testCreate() throws Exception {
-        Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("test.kernel");
-        assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("test.kernel"));
-        kernel.boot();
-        assertEquals("test.kernel kernel should be registered", kernel, KernelRegistry.getKernel("test.kernel"));
+        Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("kernel");
+        assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("kernel"));
+        kernel.boot(bundleContext);
+        assertEquals("test.kernel kernel should be registered", kernel, KernelRegistry.getKernel("kernel"));
         kernel.shutdown();
-        assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("test.kernel"));
+        assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("kernel"));
     }
 
     protected void setUp() throws Exception {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/ConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/ConfigTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/ConfigTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/ConfigTest.java Tue Dec 20 18:04:59 2011
@@ -28,6 +28,7 @@ import org.apache.geronimo.kernel.config
 import org.apache.geronimo.kernel.config.KernelConfigurationManager;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.osgi.MockBundleContext;
@@ -182,23 +183,21 @@ public class ConfigTest extends TestCase
         System.setProperty("geronimo.build.car", "true");
         super.setUp();
         kernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        kernel.boot();
+        kernel.boot(bundleContext);
 
-        ConfigurationData bootstrap = new ConfigurationData(new Artifact("bootstrap", "bootstrap", "", "car"), kernel.getNaming());
+        ArtifactManager artifactManager = new DefaultArtifactManager();
 
-        GBeanData artifactManagerData = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
+        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver();
+        artifactResolver.setArtifactManager(artifactManager);
 
-        GBeanData artifactResolverData = bootstrap.addGBean("ArtifactResolver", DefaultArtifactResolver.class);
-        artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
-
-        GBeanData configurationManagerData = bootstrap.addGBean("ConfigurationManager", KernelConfigurationManager.class);
-        configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
-        configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
-
-        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, bundleContext);
-
-        configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+        KernelConfigurationManager configurationManager = new KernelConfigurationManager();
+        configurationManager.setArtifactManager(artifactManager);
+        configurationManager.setArtifactResolver(artifactResolver);
+        configurationManager.setKernel(kernel);
+        configurationManager.activate(bundleContext);
+        this.configurationManager = configurationManager;
 
+        artifactResolver.setConfigurationManager(configurationManager);
 
         configurationData = new ConfigurationData(new Artifact("test", "test", "", "car"), kernel.getNaming());
         configurationData.setBundleContext(bundleContext);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/GBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/GBeanTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/GBeanTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/GBeanTest.java Tue Dec 20 18:04:59 2011
@@ -523,7 +523,7 @@ public class GBeanTest extends TestCase 
     protected void setUp() throws Exception {
         super.setUp();
         realKernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        realKernel.boot();
+        realKernel.boot(bundleContext);
         kernel = kernelWrapper.wrap(realKernel);
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/SimpleGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/SimpleGBeanTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/SimpleGBeanTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/SimpleGBeanTest.java Tue Dec 20 18:04:59 2011
@@ -36,13 +36,16 @@ public class SimpleGBeanTest extends Tes
     public void test() throws Exception {
         // boot the kernel
         Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        kernel.boot();
+        kernel.boot(bundleContext);
 
         // load the configuration manager bootstrap service
-        ConfigurationData bootstrap = new ConfigurationData(new Artifact("bootstrap", "bootstrap", "", "car"), kernel.getNaming());
-        bootstrap.addGBean("ConfigurationManager", KernelConfigurationManager.class);
-        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, bundleContext);
-        ConfigurationManager configurationManager = kernel.getGBean(ConfigurationManager.class);
+//        ConfigurationData bootstrap = new ConfigurationData(new Artifact("bootstrap", "bootstrap", "", "car"), kernel.getNaming());
+//        bootstrap.addGBean("ConfigurationManager", KernelConfigurationManager.class);
+//        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, bundleContext);
+//        ConfigurationManager configurationManager = kernel.getGBean(ConfigurationManager.class);
+        KernelConfigurationManager configurationManager = new KernelConfigurationManager();
+        configurationManager.setKernel(kernel);
+        configurationManager.activate(bundleContext);
 
         // create a configuration for our test bean
         Artifact configurationId = new Artifact("test", "test", "", "car");

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java Tue Dec 20 18:04:59 2011
@@ -682,13 +682,13 @@ public class ConfigurationManagerTest ex
         shouldFail.clear();
 
         kernel = KernelFactory.newInstance(bundleContext).createKernel("test");
-        kernel.boot();
+        kernel.boot(bundleContext);
 
-        GBeanData artifactManagerData = buildGBeanData("name", "ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
-        kernel.loadGBean(artifactManagerData, bundleContext);
-        kernel.startGBean(artifactManagerData.getAbstractName());
-        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactManagerData.getAbstractName()));
-        ArtifactManager artifactManager = (ArtifactManager) kernel.getGBean(artifactManagerData.getAbstractName());
+//        GBeanData artifactManagerData = buildGBeanData("name", "ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
+//        kernel.loadGBean(artifactManagerData, bundleContext);
+//        kernel.startGBean(artifactManagerData.getAbstractName());
+//        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactManagerData.getAbstractName()));
+        ArtifactManager artifactManager = new DefaultArtifactManager();
 
 
         artifact1 = new Artifact("test", "1", "1.1", "bar");

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java Tue Dec 20 18:04:59 2011
@@ -33,7 +33,6 @@ import org.apache.geronimo.gbean.GBeanDa
 import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.MockGBean;
 import org.apache.geronimo.kernel.osgi.MockBundleContext;
-import org.apache.geronimo.kernel.config.xstream.XStreamConfigurationMarshaler;
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
@@ -41,7 +40,7 @@ import org.apache.geronimo.kernel.reposi
  */
 public class ConfigurationUtilTest extends TestCase {
     private MockBundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), null, null, null);
-    private XStreamConfigurationMarshaler xstreamConfigurationMarshaler = new XStreamConfigurationMarshaler();
+//    private XStreamConfigurationMarshaler xstreamConfigurationMarshaler = new XStreamConfigurationMarshaler();
     private SerializedConfigurationMarshaler serializedConfigurationMarshaler = new SerializedConfigurationMarshaler();
     private static Artifact artifact3 = new Artifact("test", "3", "3.3", "bar");
     private static final Jsr77Naming naming = new Jsr77Naming();

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java Tue Dec 20 18:04:59 2011
@@ -87,8 +87,10 @@ public class EditableKernelConfiguration
 
     //TODO this test is not valid for KernelConfigurationManager
     public void testThatFirstStoreOfListStoresIsDefaultStore() throws Exception {
-        stores.add(storeA);
-        stores.add(storeB);
+//        stores.add(storeA);
+//        stores.add(storeB);
+        manager.bindConfigurationStore(storeA);
+        manager.bindConfigurationStore(storeB);
 
         startVerification();
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/osgi/MockBundle.java Tue Dec 20 18:04:59 2011
@@ -54,6 +54,7 @@ public class MockBundle implements Bundl
     private final String location;
     private final long id;
     private BundleContext bundleContext;
+    private int state = 2;
 
     public MockBundle(ClassLoader classLoader, String location, long id) {
         this.classLoader = classLoader;
@@ -66,19 +67,23 @@ public class MockBundle implements Bundl
     }
 
     public int getState() {
-        return 0;
+        return state;
     }
 
     public void start(int i) throws BundleException {
+        state = 32;
     }
 
     public void start() throws BundleException {
+        state = 32;
     }
 
     public void stop(int i) throws BundleException {
+        state = 2;
     }
 
     public void stop() throws BundleException {
+        state = 2;
     }
 
     public void update() throws BundleException {

Modified: geronimo/server/trunk/framework/modules/geronimo-management/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/pom.xml?rev=1221390&r1=1221389&r2=1221390&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-management/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/pom.xml Tue Dec 20 18:04:59 2011
@@ -49,35 +49,59 @@
             <version>${project.version}</version>
         </dependency>
 
-        <!-- needed by geronimo-jaxrpc_1.1_spec -->
+<!--
+        &lt;!&ndash; needed by geronimo-jaxrpc_1.1_spec &ndash;&gt;
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-saaj_1.3_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
 
-        <!-- needed by geronimo-jaxrpc_1.1_spec -->
+        &lt;!&ndash; needed by geronimo-jaxrpc_1.1_spec &ndash;&gt;
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
 
-        <!-- needed by geronimo-ejb_3.1_spec -->
+        &lt;!&ndash; needed by geronimo-ejb_3.1_spec &ndash;&gt;
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaxrpc_1.1_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
 
-        <!-- needed by geronimo-j2ee-management_1.1_spec -->
+        &lt;!&ndash; needed by geronimo-j2ee-management_1.1_spec &ndash;&gt;
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ejb_3.1_spec</artifactId>
+            <scope>provided</scope>
         </dependency>
+-->
 
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
         </dependency>
     </dependencies>
-    
+<!--
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Import-Package>javax.ejb;resolution:=optional,
+                        javax.servlet.http;resolution:=optional,
+                        javax.xml.soap;resolution:=optional,
+                        *</Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+-->
+
 </project>
 



Mime
View raw message