felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r786262 [2/3] - in /felix/trunk/karaf: ./ assembly/ assembly/src/main/descriptors/ assembly/src/main/filtered-resources/ assembly/src/main/filtered-resources/etc/ deployer/blueprint/ deployer/blueprint/src/main/resources/META-INF/spring/ de...
Date Thu, 18 Jun 2009 20:57:26 GMT
Modified: felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/felix/karaf/gshell/core/config/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/felix/karaf/gshell/core/config/NamespaceHandler.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/felix/karaf/gshell/core/config/NamespaceHandler.java (original)
+++ felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/felix/karaf/gshell/core/config/NamespaceHandler.java Thu Jun 18 20:57:23 2009
@@ -17,467 +17,269 @@
  * under the License.
  */
 package org.apache.felix.karaf.gshell.core.config;
-
+import java.net.URL;
 import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
 
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.support.GenericBeanDefinition;
-import org.springframework.beans.factory.support.ManagedList;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.RuntimeBeanReference;
-import org.springframework.beans.factory.BeanDefinitionStoreException;
-import org.springframework.beans.factory.parsing.BeanComponentDefinition;
-import org.springframework.util.StringUtils;
-import org.springframework.util.xml.DomUtils;
-import org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.gshell.wisdom.registry.CommandLocationImpl;
-import org.apache.geronimo.gshell.wisdom.command.ConfigurableCommandCompleter;
-import org.apache.geronimo.gshell.wisdom.command.LinkImpl;
-import org.apache.geronimo.gshell.wisdom.command.AliasImpl;
-import org.apache.geronimo.gshell.wisdom.command.StatefulCommand;
+import org.apache.geronimo.blueprint.ParserContext;
+import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableCollectionMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableIdRefMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableServiceMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableValueMetadata;
+import org.apache.geronimo.blueprint.mutable.MutableRefMetadata;
+import org.apache.geronimo.gshell.command.Alias;
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.Link;
-import org.apache.geronimo.gshell.command.Alias;
-import org.apache.felix.karaf.gshell.core.OsgiCommandRegistry;
-import org.apache.felix.karaf.gshell.core.BeanContainerAwareProcessor;
-
-public class NamespaceHandler extends NamespaceHandlerSupport {
-
-    public void init() {
-        registerBeanDefinitionParser(CommandParser.COMMAND_BUNDLE, new CommandParser());
-    }
-
-    public static class CommandParser extends AbstractBeanDefinitionParser {
-
-        public static final String ID = ID_ATTRIBUTE;
-
-        public static final String DESCRIPTION = "description";
-
-        public static final String PLUGIN_TEMPLATE = "pluginTemplate";
-
-        public static final String ACTION = "action";
-
-        public static final String ACTION_ID = "actionId";
-
-        public static final String COMMAND_TEMPLATE_SUFFIX = "CommandTemplate";
-
-        public static final String COMMAND_BUNDLE = "command-bundle";
-
-        public static final String NAME = "name";
-
-        public static final String LOCATION = "location";
-
-        public static final String COMMANDS = "commands";
-
-        public static final String COMMAND = "command";
-
-        public static final String DOCUMENTER = "documenter";
-
-        public static final String COMPLETER = "completer";
-
-        public static final String COMPLETERS = "completers";
-
-        public static final String BEAN = "bean";
-
-        public static final String REF = "ref";
-
-        public static final String NULL = "null";
-
-        public static final String MESSAGE_SOURCE = "message-source";
-
-        public static final String MESSAGES = "messages";
-
-        public static final String PROTOTYPE = "prototype";
-
-        public static final String ALIAS = "alias";
+import org.apache.geronimo.gshell.wisdom.command.AliasImpl;
+import org.apache.geronimo.gshell.wisdom.command.CommandMessageSource;
+import org.apache.geronimo.gshell.wisdom.command.LinkImpl;
+import org.apache.geronimo.gshell.wisdom.command.MessageSourceCommandDocumenter;
+import org.apache.geronimo.gshell.wisdom.command.StatefulCommand;
+import org.apache.geronimo.gshell.wisdom.command.StatelessCommand;
+import org.apache.geronimo.gshell.wisdom.command.ConfigurableCommandCompleter;
+import org.apache.geronimo.gshell.wisdom.registry.CommandLocationImpl;
+import org.apache.felix.karaf.gshell.core.BeanContainerWrapper;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.IdRefMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.reflect.NullMetadata;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.container.ComponentDefinitionException;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+
+
+public class NamespaceHandler implements org.apache.geronimo.blueprint.NamespaceHandler {
+
+    public static final String ID = "id";
+    public static final String DESCRIPTION = "description";
+    public static final String PLUGIN_TEMPLATE = "pluginTemplate";
+    public static final String ACTION = "action";
+    public static final String ACTION_ID = "actionId";
+    public static final String COMMAND_TEMPLATE_SUFFIX = "CommandTemplate";
+    public static final String COMMAND_BUNDLE = "command-bundle";
+    public static final String NAME = "name";
+    public static final String LOCATION = "location";
+    public static final String COMMANDS = "commands";
+    public static final String COMMAND = "command";
+    public static final String TYPE = "type";
+    public static final String DOCUMENTER = "documenter";
+    public static final String COMPLETER = "completer";
+    public static final String COMPLETERS = "completers";
+    public static final String BEAN = "bean";
+    public static final String REF = "ref";
+    public static final String NULL = "null";
+    public static final String MESSAGE_SOURCE = "message-source";
+    public static final String MESSAGES = "messages";
+    public static final String PROTOTYPE = "prototype";
+    public static final String ALIAS = "alias";
+    public static final String ALIASES = "aliases";
+    public static final String LINK = "link";
+    public static final String LINKS = "links";
+    public static final String TARGET = "target";
 
-        public static final String ALIASES = "aliases";
+    public static final String TYPE_STATEFUL = "stateful";
+    public static final String TYPE_STATELESS = "stateless";
 
-        public static final String LINK = "link";
+    private int nameCounter = 0;
 
-        public static final String LINKS = "links";
+    public URL getSchemaLocation(String namespace) {
+        return getClass().getResource("/org/apache/felix/karaf/gshell/core/karaf-gshell.xsd");
+    }
 
-        public static final String TARGET = "target";
+    public ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context) {
+        throw new ComponentDefinitionException("Bad xml syntax: node decoration is not supported");
+    }
 
-        @Override
-        protected boolean shouldGenerateId() {
-            return true;
+    public Metadata parse(Element element, ParserContext context) {
+        if (nodeNameEquals(element, COMMAND_BUNDLE)) {
+            NodeList children = element.getChildNodes();
+            for (int i = 0; i < children.getLength(); i++) {
+                Node child  = children.item(i);
+                if (child instanceof Element) {
+                    Element childElement = (Element) child;
+                    parseChildElement(childElement, context);
+                }
+            }
+            return null;
+        } else {
+            throw new IllegalStateException("Unexpected element " + element.getNodeName());
         }
+    }
 
-        @Override
-        protected boolean shouldGenerateIdAsFallback() {
-            return true;
+    private void parseChildElement(Element element, ParserContext context) {
+        if (nodeNameEquals(element, COMMAND)) {
+            parseCommand(element, context);
+        } else if (nodeNameEquals(element, LINK)) {
+            parseLink(element, context);
+        } else if (nodeNameEquals(element, ALIAS)) {
+            parseAlias(element, context);
         }
+    }
 
-        protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext context) {
-            assert element != null;
-            assert context != null;
-
-            new Builder(context).parseCommandBundle(element);
-            // We need to return a valid bean
-            BeanDefinitionBuilder dummy = BeanDefinitionBuilder.rootBeanDefinition(String.class);
-            return dummy.getBeanDefinition();
+    private void parseCommand(Element element, ParserContext context) {
+        MutableBeanMetadata command = context.createMetadata(MutableBeanMetadata.class);
+        String type = element.hasAttribute(TYPE) ? element.getAttribute(TYPE) : TYPE_STATEFUL;
+        boolean stateful;
+        if (TYPE_STATEFUL.equals(type)) {
+            command.setRuntimeClass(StatefulCommand.class);
+            stateful = true;
+        } else if (TYPE_STATELESS.equals(type)) {
+            command.setRuntimeClass(StatelessCommand.class);
+            stateful = false;
+        } else {
+            throw new ComponentDefinitionException("Bad xml syntax: unknown value '" + type + "' for attribute " + TYPE);
         }
-
-        /**
-         * Helper to build plugin related bean definitions.
-         */
-        private class Builder
-        {
-            private final Logger log = LoggerFactory.getLogger(getClass());
-
-            private ParserContext context;
-
-            public Builder(final ParserContext context) {
-                assert context != null;
-
-                this.context = context;
-            }
-
-            private String resolveId(final Element element, final BeanDefinition def) throws BeanDefinitionStoreException {
-                assert element != null;
-                assert def != null;
-
-                if (shouldGenerateId()) {
-                    return context.getReaderContext().generateBeanName(def);
-                }
-
-                String id = element.getAttribute(ID_ATTRIBUTE);
-
-                if (!StringUtils.hasText(id) && shouldGenerateIdAsFallback()) {
-                    id = context.getReaderContext().generateBeanName(def);
-                }
-
-                return id;
-            }
-
-            @SuppressWarnings({"unchecked"})
-            private List<Element> getChildElements(final Element element, final String name) {
-                assert element != null;
-                assert name != null;
-
-                return DomUtils.getChildElementsByTagName(element, name);
-            }
-
-            @SuppressWarnings({"unchecked"})
-            private List<Element> getChildElements(final Element element, final String[] names) {
-                assert element != null;
-                assert names != null;
-
-                return DomUtils.getChildElementsByTagName(element, names);
-            }
-
-            @SuppressWarnings({"unchecked"})
-            private Element getChildElement(final Element element, final String name) {
-                assert element != null;
-                assert name != null;
-
-                List<Element> elements = DomUtils.getChildElementsByTagName(element, name);
-                if (elements != null && !elements.isEmpty()) {
-                    return elements.get(0);
-                }
-                return null;
-            }
-
-            private BeanDefinitionParserDelegate createBeanDefinitionParserDelegate(final Element element) {
-                assert element != null;
-
-                BeanDefinitionParserDelegate parser = new BeanDefinitionParserDelegate(context.getReaderContext());
-                parser.initDefaults(element.getOwnerDocument().getDocumentElement());
-                return parser;
-            }
-
-            private BeanDefinitionHolder parseBeanDefinitionElement(final Element element) {
-                assert element != null;
-
-                BeanDefinitionParserDelegate parser = createBeanDefinitionParserDelegate(element);
-                return parser.parseBeanDefinitionElement(element);
-            }
-
-            private void parseAndApplyDescription(final Element element, final BeanDefinition def) {
-                assert element != null;
-                assert def != null;
-
-                Element desc = getChildElement(element, DESCRIPTION);
-                if (desc != null) {
-                    if (def instanceof AbstractBeanDefinition) {
-                        ((AbstractBeanDefinition)def).setDescription(desc.getTextContent());
+        MutableBeanMetadata beanContainer = context.createMetadata(MutableBeanMetadata.class);
+        beanContainer.setRuntimeClass(BeanContainerWrapper.class);
+        beanContainer.addArgument(createRef(context, "blueprintContainer"), BlueprintContainer.class.getName(), 0);
+        command.addProperty("beanContainer", beanContainer);
+        MutableBeanMetadata documenter = context.createMetadata(MutableBeanMetadata.class);
+        documenter.setRuntimeClass(MessageSourceCommandDocumenter.class);
+        command.addProperty(DOCUMENTER, documenter);
+        MutableBeanMetadata messages = context.createMetadata(MutableBeanMetadata.class);
+        messages.setRuntimeClass(CommandMessageSource.class);
+        command.addProperty(MESSAGES, messages);
+        MutableBeanMetadata location = context.createMetadata(MutableBeanMetadata.class);
+        location.setRuntimeClass(CommandLocationImpl.class);
+        location.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+        command.addProperty(LOCATION, location);
+
+        boolean hasAction = false;
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child  = children.item(i);
+            if (child instanceof Element) {
+                Element childElement = (Element) child;
+                if (nodeNameEquals(childElement, ACTION)) {
+                    if (hasAction) {
+                        throw new ComponentDefinitionException("Only one " + ACTION + " element can be set for a given command");
+                    }
+                    hasAction = true;
+                    MutableBeanMetadata action = parseAction(context, command, childElement);
+                    // TODO: parse other stuff or remove it from schema
+                    if (stateful) {
+                        action.setId(getName());
+                        context.getComponentDefinitionRegistry().registerComponentDefinition(action);
+                        command.addProperty(ACTION_ID, createIdRef(context, action.getId()));
+                    } else {
+                        command.addProperty(ACTION, action);
                     }
+                } else if (nodeNameEquals(childElement, COMPLETERS)) {
+                    command.addProperty(COMPLETER, parseCompleters(context, command, childElement));
+                } else {
+                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                 }
             }
+        }
 
-            private void parseAndApplyDescription(final Element element, final BeanDefinitionBuilder builder) {
-                assert element != null;
-                assert builder != null;
-
-                parseAndApplyDescription(element, builder.getRawBeanDefinition());
-            }
-
-            private BeanDefinitionHolder register(final BeanDefinitionHolder holder) {
-                assert holder != null;
-
-                registerBeanDefinition(holder, context.getRegistry());
-                return holder;
-            }
-
-            private BeanDefinitionHolder register(final BeanDefinition def, final String id) {
-                assert def != null;
-                assert id != null;
-
-                BeanDefinitionHolder holder = new BeanDefinitionHolder(def, id);
-                return register(holder);
-            }
-
-            //
-            // <gshell:command-bundle>
-            //
-
-            private void parseCommandBundle(final Element element) {
-                assert element != null;
-
-                log.trace("Parse command bundle; element; {}", element);
-
-                if (!context.getRegistry().containsBeanDefinition("$beanContainerAwareProcessor")) {
-                    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(BeanContainerAwareProcessor.class);
-                    context.getRegistry().registerBeanDefinition("$beanContainerAwareProcessor", builder.getBeanDefinition());
-                }
-
-                parseCommands(element);
-                parseLinks(element);
-                parseAliases(element);
-            }
+        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
+        commandService.setId(getName());
+        commandService.addInterfaceName(Command.class.getName());
+        commandService.setServiceComponent(command);
+        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
+    }
 
-            //
-            // <gshell:command>
-            //
-
-            private void parseCommands(final Element element) {
-                assert element != null;
-
-                log.trace("Parse commands; element; {}", element);
-
-                List<Element> children = getChildElements(element, COMMAND);
-                for (Element child : children) {
-                    parseCommand(child);
+    private MutableBeanMetadata parseAction(ParserContext context, ComponentMetadata enclosingComponent, Element element) {
+        MutableBeanMetadata action = context.createMetadata(MutableBeanMetadata.class);
+        action.setClassName(element.getAttribute("class"));
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child  = children.item(i);
+            if (child instanceof Element) {
+                Element childElement = (Element) child;
+                if (nodeNameEquals(childElement, "argument")) {
+                    action.addArgument(context.parseElement(BeanArgument.class, enclosingComponent, childElement));
+                } else if (nodeNameEquals(childElement, "property")) {
+                    action.addProperty(context.parseElement(BeanProperty.class, enclosingComponent, childElement));
                 }
             }
+        }
+        return action;
+    }
 
-            private void parseCommand(final Element element) {
-                assert element != null;
-
-                log.trace("Parse command; element; {}", element);
-
-                BeanDefinitionBuilder command = BeanDefinitionBuilder.genericBeanDefinition(StatefulCommand.class);
-                parseAndApplyDescription(element, command);
-
-                Element child;
-
-                // Required children elements
-
-                String name = element.getAttribute(NAME);
-                BeanDefinition def = new GenericBeanDefinition();
-                def.setBeanClassName(CommandLocationImpl.class.getName());
-                def.getConstructorArgumentValues().addGenericArgumentValue(name);
-                command.addPropertyValue(LOCATION, def);
-
-                child = getChildElement(element, ACTION);
-                BeanDefinitionHolder action = parseCommandAction(child);
-                command.addPropertyValue(ACTION_ID, action.getBeanName());
-
-                // Optional children elements
-
-                child = getChildElement(element, DOCUMENTER);
-                if (child != null) {
-                    BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
-                    command.addPropertyValue(DOCUMENTER, holder.getBeanDefinition());
-                } else {
-                    BeanDefinition documenter = new GenericBeanDefinition();
-                    documenter.setBeanClassName("org.apache.geronimo.gshell.wisdom.command.MessageSourceCommandDocumenter");
-                    command.addPropertyValue(DOCUMENTER, documenter);
-                }
-
-                child = getChildElement(element, COMPLETER);
-                if (child != null) {
-                    BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
-                    command.addPropertyValue(COMPLETER, holder.getBeanDefinition());
-                }
-
-                child = getChildElement(element, COMPLETERS);
-                if (child != null) {
-                    BeanDefinitionBuilder completer = parseCommandCompleters(child);
-                    command.addPropertyValue(COMPLETER, completer.getBeanDefinition());
-                }
-
-                child = getChildElement(element, MESSAGE_SOURCE);
-                if (child != null) {
-                    BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
-                    command.addPropertyValue(MESSAGES, holder.getBeanDefinition());
+    private Metadata parseCompleters(ParserContext context, ComponentMetadata enclosingComponent, Element element) {
+        MutableBeanMetadata completer = context.createMetadata(MutableBeanMetadata.class);
+        completer.setRuntimeClass(ConfigurableCommandCompleter.class);
+        MutableCollectionMetadata collection = context.createMetadata(MutableCollectionMetadata.class);
+        collection.setCollectionClass(List.class);
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child  = children.item(i);
+            if (child instanceof Element) {
+                Metadata metadata;
+                if (nodeNameEquals(child, REF)) {
+                    metadata = context.parseElement(RefMetadata.class, context.getEnclosingComponent(), (Element) child);
+                } else if (nodeNameEquals(child, NULL)) {
+                    metadata = context.parseElement(NullMetadata.class, context.getEnclosingComponent(), (Element) child);
+                } else if (nodeNameEquals(child, BEAN)) {
+                    metadata = context.parseElement(BeanMetadata.class, enclosingComponent, (Element) child);
                 } else {
-                    BeanDefinition msgSource = new GenericBeanDefinition();
-                    msgSource.setBeanClassName("org.apache.geronimo.gshell.wisdom.command.CommandMessageSource");
-                    command.addPropertyValue(MESSAGES, msgSource);
+                    throw new IllegalStateException("Unexpected element " + child.getNodeName());
                 }
-
-                //String id = resolveId(element, command.getBeanDefinition());
-                //BeanDefinitionHolder holder = register(command.getBeanDefinition(), id);
-
-                BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(OsgiServiceFactoryBean.class);
-                bd.addPropertyReference("bundleContext", "bundleContext");
-                bd.addPropertyValue("target", command.getBeanDefinition());
-                bd.addPropertyValue("interfaces", new Class[] { Command.class });
-                Map<String,String> props = new HashMap<String,String>();
-                props.put(OsgiCommandRegistry.NAME, name);
-                bd.addPropertyValue("serviceProperties", props);
-                BeanDefinition defSvc = bd.getBeanDefinition();
-                String id = context.getReaderContext().generateBeanName(defSvc);
-                BeanDefinitionHolder holder = new BeanDefinitionHolder(defSvc, id);
-                registerBeanDefinition(holder, context.getRegistry());
-                if (shouldFireEvents()) {
-                    BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
-                    postProcessComponentDefinition(componentDefinition);
-                    context.registerComponent(componentDefinition);
-                }
-            }
-
-            //
-            // <gshell:completers>
-            //
-
-            private BeanDefinitionBuilder parseCommandCompleters(final Element element) {
-                assert element != null;
-
-                BeanDefinitionBuilder completer = BeanDefinitionBuilder.rootBeanDefinition(ConfigurableCommandCompleter.class);
-
-                ManagedList completers = new ManagedList();
-
-                List<Element> children = getChildElements(element, new String[] {BEAN, REF, NULL});
-
-                for (Element child : children) {
-                    if (DomUtils.nodeNameEquals(child, BEAN)) {
-                        BeanDefinitionHolder holder = parseBeanDefinitionElement(child);
-                        // noinspection unchecked
-                        completers.add(holder.getBeanDefinition());
-                    }
-                    else if (DomUtils.nodeNameEquals(child, REF)) {
-                        BeanDefinitionParserDelegate parser = createBeanDefinitionParserDelegate(child);
-                        RuntimeBeanReference ref = (RuntimeBeanReference) parser.parsePropertySubElement(child, completer.getRawBeanDefinition());
-                        // noinspection unchecked
-                        completers.add(ref);
-                    }
-                    else if (DomUtils.nodeNameEquals(child, NULL)) {
-                        // noinspection unchecked
-                        completers.add(null);
-                    }
-                }
-
-                completer.addConstructorArgValue(completers);
-
-                return completer;
+                collection.addValue(metadata);
             }
+        }
+        completer.addArgument(collection, List.class.getName(), 0);
+        return completer;
+    }
 
-            //
-            // <gshell:action>
-            //
-
-            private BeanDefinitionHolder parseCommandAction(final Element element) {
-                assert element != null;
-
-                log.trace("Parse command action; element; {}", element);
-
-                // Construct the action
-                BeanDefinition action = parseBeanDefinitionElement(element).getBeanDefinition();
+    private void parseLink(Element element, ParserContext context) {
+        MutableBeanMetadata link = context.createMetadata(MutableBeanMetadata.class);
+        link.setRuntimeClass(LinkImpl.class);
+        link.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+        link.addArgument(createStringValue(context, element.getAttribute(TARGET)), String.class.getName(), 0);
+
+        MutableServiceMetadata linkService = context.createMetadata(MutableServiceMetadata.class);
+        linkService.setId(getName());
+        linkService.addInterfaceName(Link.class.getName());
+        linkService.setServiceComponent(link);
+        context.getComponentDefinitionRegistry().registerComponentDefinition(linkService);
+    }
 
-                // All actions are configured as prototypes
-                action.setScope(PROTOTYPE);
+    private void parseAlias(Element element, ParserContext context) {
+        MutableBeanMetadata alias = context.createMetadata(MutableBeanMetadata.class);
+        alias.setRuntimeClass(AliasImpl.class);
+        alias.addArgument(createStringValue(context, element.getAttribute(NAME)), String.class.getName(), 0);
+        alias.addArgument(createStringValue(context, element.getAttribute(ALIAS)), String.class.getName(), 0);
+
+        MutableServiceMetadata aliasService = context.createMetadata(MutableServiceMetadata.class);
+        aliasService.setId(getName());
+        aliasService.addInterfaceName(Alias.class.getName());
+        aliasService.setServiceComponent(alias);
+        context.getComponentDefinitionRegistry().registerComponentDefinition(aliasService);
+    }
 
-                // Generate id and register the bean
-                String id = resolveId(element, action);
-                return register(action, id);
-            }
+    private ValueMetadata createStringValue(ParserContext context, String str) {
+        MutableValueMetadata value = context.createMetadata(MutableValueMetadata.class);
+        value.setStringValue(str);
+        return value;
+    }
 
-            //
-            // <gshell:link>
-            //
-
-            private void parseLinks(final Element element) {
-                assert element != null;
-
-                log.trace("Parse links; element; {}", element);
-
-                List<Element> children = getChildElements(element, LINK);
-
-                for (Element child : children) {
-                    String name = child.getAttribute(NAME);
-                    String target = child.getAttribute(TARGET);
-
-                    BeanDefinitionBuilder link = BeanDefinitionBuilder.genericBeanDefinition(LinkImpl.class);
-                    link.addConstructorArgValue(name);
-                    link.addConstructorArgValue(target);
-
-                    BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(OsgiServiceFactoryBean.class);
-                    bd.addPropertyReference("bundleContext", "bundleContext");
-                    bd.addPropertyValue("target", link.getBeanDefinition());
-                    bd.addPropertyValue("interfaces", new Class[] { Link.class });
-                    BeanDefinition defSvc = bd.getBeanDefinition();
-                    String id = context.getReaderContext().generateBeanName(defSvc);
-                    BeanDefinitionHolder holder = new BeanDefinitionHolder(defSvc, id);
-                    registerBeanDefinition(holder, context.getRegistry());
-                    if (shouldFireEvents()) {
-                        BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
-                        postProcessComponentDefinition(componentDefinition);
-                        context.registerComponent(componentDefinition);
-                    }
+    private RefMetadata createRef(ParserContext context, String id) {
+        MutableRefMetadata idref = context.createMetadata(MutableRefMetadata.class);
+        idref.setComponentId(id);
+        return idref;
+    }
 
-                }
-            }
+    private IdRefMetadata createIdRef(ParserContext context, String id) {
+        MutableIdRefMetadata idref = context.createMetadata(MutableIdRefMetadata.class);
+        idref.setComponentId(id);
+        return idref;
+    }
 
-            //
-            // <gshell:alias>
-            //
-
-            private void parseAliases(final Element element) {
-                assert element != null;
-
-                log.trace("Parse aliases; element; {}", element);
-
-                List<Element> children = getChildElements(element, ALIAS);
-
-                for (Element child : children) {
-                    String name = child.getAttribute(NAME);
-                    String aliasValue = child.getAttribute(ALIAS);
-
-                    BeanDefinitionBuilder alias = BeanDefinitionBuilder.genericBeanDefinition(AliasImpl.class);
-                    alias.addConstructorArgValue(name);
-                    alias.addConstructorArgValue(aliasValue);
-
-                    BeanDefinitionBuilder bd = BeanDefinitionBuilder.genericBeanDefinition(OsgiServiceFactoryBean.class);
-                    bd.addPropertyReference("bundleContext", "bundleContext");
-                    bd.addPropertyValue("target", alias.getBeanDefinition());
-                    bd.addPropertyValue("interfaces", new Class[] { Alias.class });
-                    BeanDefinition defSvc = bd.getBeanDefinition();
-                    String id = context.getReaderContext().generateBeanName(defSvc);
-                    BeanDefinitionHolder holder = new BeanDefinitionHolder(defSvc, id);
-                    registerBeanDefinition(holder, context.getRegistry());
-                    if (shouldFireEvents()) {
-                        BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
-                        postProcessComponentDefinition(componentDefinition);
-                        context.registerComponent(componentDefinition);
-                    }
+    public synchronized String getName() {
+        return "gshell-" + ++nameCounter;
+    }
 
-                }
-            }
-        }
+    private static boolean nodeNameEquals(Node node, String name) {
+        return (name.equals(node.getNodeName()) || name.equals(node.getLocalName()));
     }
 }

Added: felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java (added)
+++ felix/trunk/karaf/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/vfs/config/CacheStrategyConverter.java Thu Jun 18 20:57:23 2009
@@ -0,0 +1,49 @@
+/*
+ * 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.gshell.vfs.config;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.apache.commons.vfs.CacheStrategy;
+
+public class CacheStrategyConverter implements Converter {
+
+    public boolean canConvert(Object o, Class aClass) {
+        return o instanceof String && aClass == CacheStrategy.class;
+    }
+
+    public Object convert(Object o, Class aClass) throws Exception {
+        if (canConvert(o, aClass)) {
+            String text = o.toString();
+            if (text.equalsIgnoreCase("MANUAL")) {
+                return CacheStrategy.MANUAL;
+            }
+            else if (text.equalsIgnoreCase("ON_RESOLVE")) {
+                return CacheStrategy.ON_RESOLVE;
+            }
+            else if (text.equalsIgnoreCase("ON_CALL")) {
+                return CacheStrategy.ON_CALL;
+            }
+            else {
+                throw new IllegalArgumentException("Unknown cache strategy: " + text);
+            }
+        }
+        return null;
+    }
+
+}

Added: felix/trunk/karaf/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml (added)
+++ felix/trunk/karaf/gshell/gshell-core/src/main/resources/OSGI-INF/blueprint/gshell-namespacehandler.xml Thu Jun 18 20:57:23 2009
@@ -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">
+
+    <service interface="org.apache.geronimo.blueprint.NamespaceHandler">
+        <service-properties>
+            <entry key="osgi.service.blueprint.namespace" value="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0"/>
+        </service-properties>
+        <bean class="org.apache.felix.karaf.gshell.core.config.NamespaceHandler"/>
+    </service>
+
+</blueprint>

Copied: felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/karaf-gshell.xsd (from r785868, felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/servicemix-gshell.xsd)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/karaf-gshell.xsd?p2=felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/karaf-gshell.xsd&p1=felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/servicemix-gshell.xsd&r1=785868&r2=786262&rev=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/servicemix-gshell.xsd (original)
+++ felix/trunk/karaf/gshell/gshell-core/src/main/resources/org/apache/felix/karaf/gshell/core/karaf-gshell.xsd Thu Jun 18 20:57:23 2009
@@ -20,14 +20,14 @@
 
 <!-- $Rev: 699828 $ $Date: 2008-09-28 16:35:27 +0200 (Sun, 28 Sep 2008) $ -->
 
-<xsd:schema xmlns="http://servicemix.apache.org/schema/servicemix-gshell"
+<xsd:schema xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-        xmlns:beans="http://www.springframework.org/schema/beans"
-        targetNamespace="http://servicemix.apache.org/schema/servicemix-gshell"
+        xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+        targetNamespace="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
 
-    <xsd:import namespace="http://www.springframework.org/schema/beans"/>
+    <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0"/>
 
     <xsd:annotation>
         <xsd:documentation>
@@ -43,7 +43,6 @@
                 </xsd:documentation>
             </xsd:annotation>
             <xsd:sequence>
-                <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
                 <xsd:choice minOccurs="0" maxOccurs="unbounded">
 					<xsd:element ref="command"/>
 					<xsd:element ref="alias"/>
@@ -61,7 +60,6 @@
                 </xsd:documentation>
             </xsd:annotation>
             <xsd:sequence>
-                <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
                 <!--
                 NOTE: Not using an xsd:choice here, as I can't seem to figure out how to get it to properly
                       validate the min/max of the containted elements.  W/o the xsd:choice the validation
@@ -86,9 +84,6 @@
                     Defines a link command.
                 </xsd:documentation>
             </xsd:annotation>
-            <xsd:sequence>
-                <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
-            </xsd:sequence>
             <xsd:attribute name="name" type="xsd:string" use="required"/>
             <xsd:attribute name="target" type="xsd:string" use="required"/>
         </xsd:complexType>
@@ -102,14 +97,9 @@
             </xsd:documentation>
         </xsd:annotation>
 		<xsd:sequence>
-			<xsd:element ref="beans:description" minOccurs="0"/>
 			<xsd:choice minOccurs="0" maxOccurs="unbounded">
-				<xsd:element ref="beans:meta"/>
-				<xsd:element ref="beans:constructor-arg"/>
-				<xsd:element ref="beans:property"/>
-				<xsd:element ref="beans:qualifier"/>
-				<xsd:element ref="beans:lookup-method"/>
-				<xsd:element ref="beans:replaced-method"/>
+                <xsd:element name="argument" type="bp:Targument"/>
+                <xsd:element name="property" type="bp:Tproperty"/>
 				<!--
 				NOTE: This seems to cause schema validation problems... not really sure why
 				<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
@@ -126,35 +116,8 @@
             </xsd:documentation>
         </xsd:annotation>
 		<xsd:attribute name="class" type="xsd:string"/>
-		<xsd:attribute name="parent" type="xsd:string"/>
-		<xsd:attribute name="autowire" default="default">
-			<xsd:simpleType>
-				<xsd:restriction base="xsd:NMTOKEN">
-					<xsd:enumeration value="default"/>
-					<xsd:enumeration value="no"/>
-					<xsd:enumeration value="byName"/>
-					<xsd:enumeration value="byType"/>
-					<xsd:enumeration value="constructor"/>
-					<xsd:enumeration value="autodetect"/>
-				</xsd:restriction>
-			</xsd:simpleType>
-		</xsd:attribute>
-		<xsd:attribute name="dependency-check" default="default">
-			<xsd:simpleType>
-				<xsd:restriction base="xsd:NMTOKEN">
-					<xsd:enumeration value="default"/>
-					<xsd:enumeration value="none"/>
-					<xsd:enumeration value="simple"/>
-					<xsd:enumeration value="objects"/>
-					<xsd:enumeration value="all"/>
-				</xsd:restriction>
-			</xsd:simpleType>
-		</xsd:attribute>
 		<xsd:attribute name="depends-on" type="xsd:string"/>
-		<xsd:attribute name="autowire-candidate" default="default" type="beans:defaultable-boolean"/>
-		<xsd:attribute name="primary" type="xsd:boolean"/>
 		<xsd:attribute name="init-method" type="xsd:string"/>
-		<xsd:attribute name="destroy-method" type="xsd:string"/>
 		<xsd:attribute name="factory-method" type="xsd:string"/>
 		<xsd:attribute name="factory-bean" type="xsd:string"/>
 		<xsd:anyAttribute namespace="##other" processContents="lax"/>
@@ -218,9 +181,9 @@
             </xsd:annotation>
             <xsd:sequence>
                 <xsd:choice minOccurs="1" maxOccurs="unbounded">
-                    <xsd:element ref="beans:bean"/>
-                    <xsd:element ref="beans:ref"/>
-                    <xsd:element ref="beans:null"/>
+                    <xsd:element name="bean" type="bp:Tbean"/>
+                    <xsd:element name="ref" type="bp:Tref"/>
+                    <xsd:element name="null" type="bp:Tnull"/>
                 </xsd:choice>
             </xsd:sequence>
         </xsd:complexType>
@@ -246,9 +209,6 @@
                     Defines a command alias.
                 </xsd:documentation>
             </xsd:annotation>
-            <xsd:sequence>
-                <xsd:element ref="beans:description" minOccurs="0" maxOccurs="1"/>
-            </xsd:sequence>
             <xsd:attribute name="name" type="xsd:string" use="required"/>
             <xsd:attribute name="alias" type="xsd:string" use="required"/>
         </xsd:complexType>

Modified: felix/trunk/karaf/gshell/gshell-features/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-features/pom.xml Thu Jun 18 20:57:23 2009
@@ -92,15 +92,15 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            javax.management,
+                            javax.management.loading,
                             org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,
-                            org.springframework.beans.factory.config,
                             *
                         </Import-Package>
                         <Private-Package>!*</Private-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Modified: felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java (original)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java Thu Jun 18 20:57:23 2009
@@ -22,13 +22,10 @@
 import java.util.Map;
 
 import org.apache.felix.karaf.gshell.features.Feature;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedResource;
 
 /**
  * A feature
  */
-@ManagedResource(description = "Managed Feature", currencyTimeLimit = 15)
 public class FeatureImpl implements Feature {
 
     private String id;
@@ -50,17 +47,14 @@
         this.id = name + "-" + version;
     }
 
-    @ManagedAttribute(description = "Feature Unique ID")
     public String getId() {
         return id;
     }
 
-    @ManagedAttribute(description = "Feature Name")
     public String getName() {
         return name;
     }
 
-    @ManagedAttribute(description = "Feature Version")
     public String getVersion() {
 		return version;
 	}
@@ -69,7 +63,6 @@
 		this.version = version;
 	}
 
-    @ManagedAttribute(description = "List of Dependencies")
     public List<Feature> getDependencies() {
         return dependencies;
     }

Modified: felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java (original)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java Thu Jun 18 20:57:23 2009
@@ -53,7 +53,6 @@
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 import org.osgi.service.prefs.PreferencesService;
-import org.springframework.osgi.context.BundleContextAware;
 
 /**
  * The Features service implementation.
@@ -62,7 +61,7 @@
  * installing the needed bundles.
  *
  */
-public class FeaturesServiceImpl implements FeaturesService, BundleContextAware {
+public class FeaturesServiceImpl implements FeaturesService {
 
     private static final String ALIAS_KEY = "_alias_factory_pid";
 

Modified: felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java (original)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java Thu Jun 18 20:57:23 2009
@@ -39,15 +39,11 @@
 
 import org.apache.felix.karaf.gshell.features.Feature;
 import org.apache.felix.karaf.gshell.features.Repository;
-import org.springframework.jmx.export.annotation.ManagedAttribute;
-import org.springframework.jmx.export.annotation.ManagedOperation;
-import org.springframework.jmx.export.annotation.ManagedResource;
 import org.xml.sax.SAXException;
 
 /**
  * The repository implementation.
  */
-@ManagedResource
 public class RepositoryImpl implements Repository {
 
     private URI uri;
@@ -58,12 +54,10 @@
         this.uri = uri;
     }
 
-    @ManagedAttribute
     public URI getURI() {
         return uri;
     }
 
-    @ManagedOperation
     public URI[] getRepositories() throws Exception {
         if (repositories == null) {
             load();
@@ -71,7 +65,6 @@
         return repositories.toArray(new URI[repositories.size()]);
     }
 
-    @ManagedOperation(description = "List of Features provided by this repository")
     public Feature[] getFeatures() throws Exception {
         if (features == null) {
             load();

Modified: felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistry.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistry.java (original)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistry.java Thu Jun 18 20:57:23 2009
@@ -181,7 +181,7 @@
         }
     }
 
-    public void registerMBeanServer(MBeanServer mbeanServer, Map props ) throws Exception {
+    public void registerMBeanServer(MBeanServer mbeanServer, Map props) throws Exception {
         if (mbeanServer != null) {
             this.mbeanServer = mbeanServer;
         }
@@ -204,7 +204,10 @@
             installedFeatures.put(feature.getId(), feature);
             managementAgent.register(feature, namingStrategy.getObjectName(feature, true));
         }
+    }
 
+    public void unregisterMBeanServer(MBeanServer mbeanServer, Map props) throws Exception {
+        // TODO
     }
 
     

Added: felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml (added)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml Thu Jun 18 20:57:23 2009
@@ -0,0 +1,126 @@
+<?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"
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <ext:property-placeholder placeholder-prefix="$(" placeholder-suffix=")"/>
+
+    <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" ignore-missing-locations="true">
+        <ext:default-properties>
+            <ext:property name="featuresRepositories" value=""/>
+            <ext:property name="featuresBoot" value=""/>
+        </ext:default-properties>
+        <ext:location>file:$(karaf.home)/etc/org.apache.felix.karaf.features.cfg</ext:location>
+    </ext:property-placeholder>
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="features/addUrl">
+            <action class="org.apache.felix.karaf.gshell.features.commands.AddUrlCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="features/listUrl">
+            <action class="org.apache.felix.karaf.gshell.features.commands.ListUrlCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="features/removeUrl">
+            <action class="org.apache.felix.karaf.gshell.features.commands.RemoveUrlCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+            <completers>
+                <ref component-id="removeUrlCompleter" />
+            </completers>
+        </command>
+        <command name="features/refreshUrl">
+            <action class="org.apache.felix.karaf.gshell.features.commands.RefreshUrlCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="features/install">
+            <action class="org.apache.felix.karaf.gshell.features.commands.InstallFeatureCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+            <completers>
+                <ref component-id="installFeatureCompleter" />
+            </completers>
+        </command>
+        <command name="features/uninstall">
+            <action class="org.apache.felix.karaf.gshell.features.commands.UninstallFeatureCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+            <completers>
+                <ref component-id="uninstallFeatureCompleter" />
+            </completers>
+        </command>
+        <command name="features/list">
+            <action class="org.apache.felix.karaf.gshell.features.commands.ListFeaturesCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+    </command-bundle>
+
+    <bean id="featuresService" class="org.apache.felix.karaf.gshell.features.internal.FeaturesServiceImpl" init-method="start" destroy-method="stop">
+        <property name="urls" value="$[featuresRepositories]" />
+        <property name="boot" value="$[featuresBoot]" />
+        <property name="configAdmin" ref="configAdmin" />
+        <property name="preferences" ref="preferences" />
+        <property name="featuresServiceRegistry" ref="featureServiceRegistry" />
+        <property name="bundleContext" ref="blueprintBundleContext" />
+    </bean>
+
+    <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
+
+    <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" availability="optional"/>
+
+    <service ref="featuresService" interface="org.apache.felix.karaf.gshell.features.FeaturesService" />
+
+    <bean id="installFeatureCompleter" class="org.apache.felix.karaf.gshell.features.completers.AvailableFeatureCompleter">
+        <property name="featuresRegistry" ref="featureServiceRegistry" />
+    </bean>
+
+    <bean id="uninstallFeatureCompleter" class="org.apache.felix.karaf.gshell.features.completers.InstalledFeatureCompleter">
+        <property name="featuresRegistry" ref="featureServiceRegistry" />
+    </bean>
+
+    <bean id="removeUrlCompleter" class="org.apache.felix.karaf.gshell.features.completers.FeatureRepositoryCompleter">
+        <property name="featuresRegistry" ref="featureServiceRegistry" />
+    </bean>
+
+    <!-- Management -->
+
+    <bean id="namingStrategy" class="org.apache.felix.karaf.gshell.features.management.DefaultNamingStrategy">
+        <property name="jmxDomainName" value="org.apache.felix.karaf" />
+    </bean>
+
+    <bean id="managementAgent" class="org.apache.felix.karaf.gshell.features.management.ManagementAgent" destroy-method="destroy">
+        <property name="mbeanServer" ref="mbeanServer" />
+    </bean>
+
+    <bean id="featureServiceRegistry" class="org.apache.felix.karaf.gshell.features.management.ManagedFeaturesRegistry" init-method="init">
+        <property name="managementAgent" ref="managementAgent" />
+        <property name="namingStrategy" ref="namingStrategy" />
+    </bean>
+
+    <reference id="mbeanServer" interface="javax.management.MBeanServer" availability="optional">
+        <listener ref="featureServiceRegistry" bind-method="registerMBeanServer" unbind-method="unregisterMBeanServer"/>
+    </reference>
+
+</blueprint>

Modified: felix/trunk/karaf/gshell/gshell-log/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-log/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-log/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-log/pom.xml Thu Jun 18 20:57:23 2009
@@ -85,7 +85,6 @@
                             *
                         </Import-Package>
                         <Private-Package>!*</Private-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Added: felix/trunk/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/blueprint/gshell-log.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/blueprint/gshell-log.xml?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/blueprint/gshell-log.xml (added)
+++ felix/trunk/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/blueprint/gshell-log.xml Thu Jun 18 20:57:23 2009
@@ -0,0 +1,77 @@
+<?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"
+           xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0">
+
+    <!-- TODO: use dynamic CM config -->
+
+    <cm:property-placeholder persistent-id="org.apache.felix.karaf.log">
+        <cm:default-properties>
+            <cm:property name="size" value="500"/>
+            <cm:property name="pattern" value="%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n"/>
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="log/display">
+            <action class="org.apache.felix.karaf.gshell.log.DisplayLog">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+                <property name="events" ref="events"/>
+                <property name="pattern" value="${pattern}"/>
+            </action>
+        </command>
+        <link name="log/d" target="log/display"/>
+        <command name="log/display-exception">
+            <action class="org.apache.felix.karaf.gshell.log.DisplayException">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+                <property name="events" ref="events"/>
+            </action>
+        </command>
+        <link name="log/de" target="log/display-exception"/>
+        <command name="log/get">
+            <action class="org.apache.felix.karaf.gshell.log.GetLogLevel">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="log/set">
+            <action class="org.apache.felix.karaf.gshell.log.SetLogLevel">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+
+        <alias name="ld" alias="log/d"/>
+        <alias name="lde" alias="log/de"/>
+    </command-bundle>
+
+    <bean id="vmLogAppender" class="org.apache.felix.karaf.gshell.log.VmLogAppender">
+        <property name="events" ref="events"/>
+    </bean>
+
+    <bean id="events" class="org.apache.felix.karaf.gshell.log.LruList">
+        <argument value="${size}"/>
+    </bean>
+
+    <service ref="vmLogAppender" interface="org.ops4j.pax.logging.spi.PaxAppender">
+        <service-properties>
+            <entry key="org.ops4j.pax.logging.appender.name" value="VmLogAppender"/>
+        </service-properties>
+    </service>
+
+</blueprint>

Modified: felix/trunk/karaf/gshell/gshell-obr/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-obr/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-obr/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-obr/pom.xml Thu Jun 18 20:57:23 2009
@@ -79,7 +79,6 @@
                             *
                         </Import-Package>
                         <Private-Package>!*</Private-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Modified: felix/trunk/karaf/gshell/gshell-osgi/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-osgi/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-osgi/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-osgi/pom.xml Thu Jun 18 20:57:23 2009
@@ -77,7 +77,6 @@
                             *
                         </Import-Package>
                         <Private-Package>!*</Private-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Added: felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/BlueprintListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/BlueprintListener.java?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/BlueprintListener.java (added)
+++ felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/BlueprintListener.java Thu Jun 18 20:57:23 2009
@@ -0,0 +1,109 @@
+/*
+ * 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.felix.karaf.gshell.osgi;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.blueprint.container.BlueprintEvent;
+
+/**
+ *
+ * TODO: use event admin to receive WAIT topics notifications from blueprint extender
+ *
+ */
+public class BlueprintListener implements org.osgi.service.blueprint.container.BlueprintListener, BundleListener {
+
+    public static enum BlueprintState {
+        Unknown,
+        Creating,
+        Created,
+        Destroying,
+        Destroyed,
+        Failure,
+        GracePeriod,
+        Waiting
+    }
+
+    private static final Log LOG = LogFactory.getLog(BlueprintListener.class);
+
+    private final Map<Long, BlueprintState> states;
+    private BundleContext bundleContext;
+
+    public BlueprintListener() {
+        this.states = new ConcurrentHashMap<Long, BlueprintState>();
+    }
+
+    public BlueprintState getBlueprintState(Bundle bundle) {
+        BlueprintState state = states.get(bundle.getBundleId());
+        if (state == null || bundle.getState() != Bundle.ACTIVE) {
+            state = BlueprintState.Unknown;
+        }
+        return state;
+    }
+
+    public void blueprintEvent(BlueprintEvent blueprintEvent) {
+        BlueprintState state = getState(blueprintEvent);
+        LOG.debug("Blueprint app state changed to " + state + " for bundle " + blueprintEvent.getBundle().getBundleId());
+        states.put(blueprintEvent.getBundle().getBundleId(), state);
+    }
+
+    public void bundleChanged(BundleEvent event) {
+        if (event.getType() == BundleEvent.UNINSTALLED) {
+            states.remove(event.getBundle().getBundleId());
+        }
+    }
+
+    public void setBundleContext(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+    }
+
+    public void init() throws Exception {
+        bundleContext.addBundleListener(this);
+    }
+
+    public void destroy() throws Exception {
+        bundleContext.removeBundleListener(this);
+    }
+
+    private BlueprintState getState(BlueprintEvent blueprintEvent) {
+        switch (blueprintEvent.getType()) {
+            case BlueprintEvent.CREATING:
+                return BlueprintState.Creating;
+            case BlueprintEvent.CREATED:
+                return BlueprintState.Created;
+            case BlueprintEvent.DESTROYING:
+                return BlueprintState.Destroying;
+            case BlueprintEvent.DESTROYED:
+                return BlueprintState.Destroyed;
+            case BlueprintEvent.FAILURE:
+                return BlueprintState.Failure;
+            case BlueprintEvent.GRACE_PERIOD:
+                return BlueprintState.GracePeriod;
+            case BlueprintEvent.WAITING:
+                return BlueprintState.Waiting;
+            default:
+                return BlueprintState.Unknown;
+        }
+    }
+}

Modified: felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/ListBundles.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/ListBundles.java?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/ListBundles.java (original)
+++ felix/trunk/karaf/gshell/gshell-osgi/src/main/java/org/apache/felix/karaf/gshell/osgi/ListBundles.java Thu Jun 18 20:57:23 2009
@@ -35,14 +35,14 @@
     @Option(name = "-u", description = "Show update")
     boolean showUpdate;
 
-    private SpringApplicationListener springApplicationListener;
+    private BlueprintListener blueprintListener;
 
-    public SpringApplicationListener getSpringApplicationListener() {
-        return springApplicationListener;
+    public BlueprintListener getBlueprintListener() {
+        return blueprintListener;
     }
 
-    public void setSpringApplicationListener(SpringApplicationListener springApplicationListener) {
-        this.springApplicationListener = springApplicationListener;
+    public void setBlueprintListener(BlueprintListener blueprintListener) {
+        this.blueprintListener = blueprintListener;
     }
 
     protected Object doExecute() throws Exception {
@@ -124,7 +124,7 @@
                 }
                 io.out.println("[" + id + "] ["
                     + getStateString(bundles[i])
-                    + "] [" + getSpringStateString(bundles[i])
+                    + "] [" + getBlueprintStateString(bundles[i])
                     + "] [" + level + "] " + name);
 
                 if (admin != null) {
@@ -188,16 +188,25 @@
         }
     }
 
-    public String getSpringStateString(Bundle bundle) {
-        SpringApplicationListener.SpringState state = springApplicationListener.getSpringState(bundle);
-        if (state == SpringApplicationListener.SpringState.Waiting) {
-            return "Waiting";
-        } else if (state == SpringApplicationListener.SpringState.Started) {
-            return "Started";
-        } else if (state == SpringApplicationListener.SpringState.Failed) {
-            return "Failed ";
-        } else {
-            return "       ";
+    public String getBlueprintStateString(Bundle bundle) {
+        BlueprintListener.BlueprintState state = blueprintListener.getBlueprintState(bundle);
+        switch (state) {
+            case Creating:
+                return "Creating   ";
+            case Created:
+                return "Created    ";
+            case Destroying:
+                return "Destroying ";
+            case Destroyed:
+                return "Destroyed  ";
+            case Failure:
+                return "Failure    ";
+            case GracePeriod:
+                return "GracePeriod";
+            case Waiting:
+                return "Waiting    ";
+            default:
+                return "           ";
         }
     }
 }

Added: felix/trunk/karaf/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml (added)
+++ felix/trunk/karaf/gshell/gshell-osgi/src/main/resources/OSGI-INF/blueprint/gshell-osgi.xml Thu Jun 18 20:57:23 2009
@@ -0,0 +1,100 @@
+<?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">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="osgi/bundle-level">
+            <action class="org.apache.felix.karaf.gshell.osgi.BundleLevel">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/headers">
+            <action class="org.apache.felix.karaf.gshell.osgi.Headers">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/install">
+            <action class="org.apache.felix.karaf.gshell.osgi.InstallBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/list">
+            <action class="org.apache.felix.karaf.gshell.osgi.ListBundles">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+                <property name="blueprintListener" ref="blueprintListener"/>
+            </action>
+        </command>
+        <command name="osgi/ls">
+            <action class="org.apache.felix.karaf.gshell.osgi.ListServices">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/refresh">
+            <action class="org.apache.felix.karaf.gshell.osgi.RefreshBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/update">
+            <action class="org.apache.felix.karaf.gshell.osgi.UpdateBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/resolve">
+            <action class="org.apache.felix.karaf.gshell.osgi.ResolveBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/restart">
+            <action class="org.apache.felix.karaf.gshell.osgi.RestartBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/shutdown">
+            <action class="org.apache.felix.karaf.gshell.osgi.Shutdown">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/start">
+            <action class="org.apache.felix.karaf.gshell.osgi.StartBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/start-level">
+            <action class="org.apache.felix.karaf.gshell.osgi.StartLevel">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/stop">
+            <action class="org.apache.felix.karaf.gshell.osgi.StopBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="osgi/uninstall">
+            <action class="org.apache.felix.karaf.gshell.osgi.UninstallBundle">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+    </command-bundle>
+
+    <bean id="blueprintListener" class="org.apache.felix.karaf.gshell.osgi.BlueprintListener" />
+
+    <service ref="blueprintListener" interface="org.osgi.service.blueprint.container.BlueprintListener" />
+
+</blueprint>
\ No newline at end of file

Modified: felix/trunk/karaf/gshell/gshell-packages/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-packages/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-packages/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-packages/pom.xml Thu Jun 18 20:57:23 2009
@@ -78,7 +78,6 @@
                             *
                         </Import-Package>
                         <Private-Package>!*</Private-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Added: felix/trunk/karaf/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml?rev=786262&view=auto
==============================================================================
--- felix/trunk/karaf/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml (added)
+++ felix/trunk/karaf/gshell/gshell-packages/src/main/resources/OSGI-INF/blueprint/gshell-packages.xml Thu Jun 18 20:57:23 2009
@@ -0,0 +1,35 @@
+<?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">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="packages/exports">
+            <action class="org.apache.felix.karaf.gshell.packages.ExportsCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+        <command name="packages/imports">
+            <action class="org.apache.felix.karaf.gshell.packages.ImportsCommand">
+                <property name="bundleContext" ref="blueprintBundleContext"/>
+            </action>
+        </command>
+    </command-bundle>
+
+</blueprint>

Modified: felix/trunk/karaf/gshell/gshell-run/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-run/pom.xml?rev=786262&r1=786261&r2=786262&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-run/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-run/pom.xml Thu Jun 18 20:57:23 2009
@@ -68,7 +68,6 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-                        <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
                             org.apache.commons.vfs,
                             org.apache.commons.vfs.cache,
@@ -133,10 +132,9 @@
                             org.apache.sshd,
                             org.apache.sshd.server.keyprovider,
                             org.apache.sshd.server.jaas,
-                            org.springframework.beans.factory.config,
+                            org.osgi.service.blueprint.container,
                             *
                         </Import-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>



Mime
View raw message