Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 68396 invoked from network); 18 Sep 2008 17:41:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Sep 2008 17:41:19 -0000 Received: (qmail 72745 invoked by uid 500); 18 Sep 2008 17:41:15 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 72689 invoked by uid 500); 18 Sep 2008 17:41:15 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 72680 invoked by uid 99); 18 Sep 2008 17:41:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 10:41:15 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 17:40:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A0163238889B; Thu, 18 Sep 2008 10:40:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696738 - in /geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main: java/org/apache/geronimo/gshell/commands/admin/ resources/META-INF/spring/ resources/org/apache/geronimo/gshell/commands/admin/ Date: Thu, 18 Sep 2008 17:40:27 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080918174027.A0163238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Thu Sep 18 10:40:27 2008 New Revision: 696738 URL: http://svn.apache.org/viewvc?rev=696738&view=rev Log: Add command to install a new GShell plugin Added: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java (with props) geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties (with props) Modified: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java 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/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java?rev=696738&view=auto ============================================================================== --- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java (added) +++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java Thu Sep 18 10:40:27 2008 @@ -0,0 +1,75 @@ +/* + * 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.application.plugin.PluginManager; +import org.apache.geronimo.gshell.clp.Option; +import org.apache.geronimo.gshell.command.CommandAction; +import org.apache.geronimo.gshell.command.CommandContext; +import org.apache.geronimo.gshell.io.IO; +import org.apache.geronimo.gshell.model.application.PluginArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Install a GShell plugin. + * + * @version $Rev$ $Date$ + */ +public class InstallPluginCommand + implements CommandAction +{ + private final Logger log = LoggerFactory.getLogger(getClass()); + + @Autowired + private PluginManager pluginManager; + + @Option(name="-g", aliases={"--groupId"}, argumentRequired=true, metaVar="GROUP-ID", required=true) + private String groupId; + + @Option(name="-a", aliases={"--artifactId"}, argumentRequired=true, metaVar="ARTIFACT-ID", required=true) + private String artifactId; + + @Option(name="-v", aliases={"--version"}, argumentRequired=true, metaVar="VERSION", required=true) + private String version; + + public Object execute(final CommandContext context) throws Exception { + assert context != null; + IO io = context.getIo(); + + PluginArtifact artifact = new PluginArtifact(); + artifact.setGroupId(groupId); + artifact.setArtifactId(artifactId); + artifact.setVersion(version); + + io.out.println("Loading plugin: " + artifact.getId()); + + assert pluginManager != null; + try { + pluginManager.loadPlugin(artifact); + return Result.SUCCESS; + } + catch (Exception e) { + log.error("Failed to load plugin", e); + return Result.FAILURE; + } + } +} \ No newline at end of file Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.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/InstallPluginCommand.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: 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=696738&r1=696737&r2=696738&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java (original) +++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ListPluginsCommand.java Thu Sep 18 10:40:27 2008 @@ -31,7 +31,7 @@ import java.util.Set; /** - * ??? + * List installed GShell plugins. * * @version $Rev$ $Date$ */ Modified: 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=696738&r1=696737&r2=696738&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml (original) +++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml Thu Sep 18 10:40:27 2008 @@ -53,6 +53,14 @@ + + + + + + + + Added: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties?rev=696738&view=auto ============================================================================== --- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties (added) +++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties Thu Sep 18 10:40:27 2008 @@ -0,0 +1,35 @@ +## +## 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=install-plugin + +command.description=Install a GShell plugin. + +command.option.groupId=Specify the groupId + +command.option.artifactId=Specify the artifactId + +command.option.version=Specify the version + +command.manual=\ + TODO: install-plugin manual \ No newline at end of file Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/org/apache/geronimo/gshell/commands/admin/InstallPluginCommand.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/InstallPluginCommand.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain