geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r696711 - in /geronimo/gshell/trunk: gshell-assembly/src/main/underlay/etc/ gshell-commands/gshell-admin/src/main/java/org/ gshell-commands/gshell-admin/src/main/java/org/apache/ gshell-commands/gshell-admin/src/main/java/org/apache/geronim...
Date Thu, 18 Sep 2008 17:01:58 GMT
Author: jdillon
Date: Thu Sep 18 10:01:57 2008
New Revision: 696711

URL: http://svn.apache.org/viewvc?rev=696711&view=rev
Log:
Add command to list installed plugins
Add gshell-admin to the application plugins loaded by default

Added:
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
  (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
  (with props)
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
  (with props)
Modified:
    geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml

Modified: geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml?rev=696711&r1=696710&r2=696711&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml (original)
+++ geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml Thu Sep 18
10:01:57 2008
@@ -61,6 +61,10 @@
                 <artifactId>gshell-builtins</artifactId>
             </plugin>
 
+            <plugin>
+                <artifactId>gshell-admin</artifactId>
+            </plugin>
+
             <!--
             <plugin>
                 <artifactId>gshell-optional</artifactId>

Added: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java?rev=696711&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
(added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
Thu Sep 18 10:01:57 2008
@@ -0,0 +1,61 @@
+/*
+ * 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.commands.admin;
+
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.application.plugin.PluginManager;
+import org.apache.geronimo.gshell.application.plugin.Plugin;
+import org.apache.geronimo.gshell.io.IO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Set;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class ListPluginsCommand
+    implements CommandAction
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private PluginManager pluginManager;
+
+    public Object execute(final CommandContext context) throws Exception {
+        assert context != null;
+        IO io = context.getIo();
+
+        assert pluginManager != null;
+        Set<Plugin> plugins = pluginManager.getPlugins();
+
+        io.out.println("Installed plugins:");
+
+        for (Plugin plugin : plugins) {
+            io.out.println("    " + plugin.getId());
+        }
+        
+        return Result.SUCCESS;
+    }
+}

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml?rev=696711&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
(added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
Thu Sep 18 10:01:57 2008
@@ -0,0 +1,60 @@
+<?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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="
+            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+    <context:annotation-config/>
+
+    <bean class="org.apache.geronimo.gshell.wisdom.plugin.PluginImpl">
+        <property name="id" value="gshell-admin"/>
+
+        <property name="activationRules">
+            <list>
+                <bean class="org.apache.geronimo.gshell.wisdom.plugin.activation.DefaultCommandBundleActivationRule">
+                    <property name="bundleId" value="default"/>
+                </bean>
+            </list>
+        </property>
+    </bean>
+
+    <bean class="org.apache.geronimo.gshell.wisdom.plugin.CommandBundle" lazy-init="true">
+        <property name="id" value="default"/>
+
+        <property name="commands">
+            <list>
+                <bean class="org.apache.geronimo.gshell.wisdom.command.CommandImpl">
+                    <property name="id" value="gshell-admin:list-plugins"/>
+
+                    <property name="action">
+                        <bean class="org.apache.geronimo.gshell.commands.admin.ListPluginsCommand"/>
+                    </property>
+                </bean>
+            </list>
+        </property>
+    </bean>
+
+</beans>
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties?rev=696711&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
(added)
+++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
Thu Sep 18 10:01:57 2008
@@ -0,0 +1,29 @@
+##
+## 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+command.name=list-plugins
+
+command.description=List installed GShell plugins.
+
+command.manual=\
+  TODO: list-plugins manual
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message