You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2010/04/29 07:43:40 UTC
svn commit: r939201 - in /geronimo/server/trunk/framework/modules:
geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/
geronimo-main/src/main/java/org/apache/geronimo/main/
geronimo-shell-base/src/main/java/org/apache/geronim...
Author: gawor
Date: Thu Apr 29 05:43:39 2010
New Revision: 939201
URL: http://svn.apache.org/viewvc?rev=939201&view=rev
Log:
GERONIMO-5213: More improvments for Geronimo Karaf shell commands. Refactored RemoteDeploymentManager so that the same set of operations can be invoked remote or locally.
Added:
geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java (with props)
Modified:
geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/LocalDeploymentManager.java
geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/cluster/ClusterCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DeployModuleCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DistributeCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/EncryptCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallLibraryCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallPluginCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListModulesCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListPluginsCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListTargetsCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/LoginCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/NewInstanceCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RedeployModuleCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RestartModuleCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StartModuleCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StopModuleCommand.java
geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/UndeployModuleCommand.java
Added: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java?rev=939201&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java Thu Apr 29 05:43:39 2010
@@ -0,0 +1,255 @@
+/**
+ * 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.deployment.plugin.jmx;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.security.auth.login.FailedLoginException;
+
+import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
+import org.apache.geronimo.deployment.spi.ModuleConfigurer;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InvalidGBeanException;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.system.plugin.DownloadPoller;
+import org.apache.geronimo.system.plugin.DownloadResults;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
+import org.apache.geronimo.system.plugin.ServerArchiver;
+import org.apache.geronimo.system.plugin.model.AttributesType;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Connects to a Kernel in a remote VM (may or many not be on the same machine).
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ExtendedDeploymentManager extends JMXDeploymentManager implements GeronimoDeploymentManager {
+
+ private static final Logger log = LoggerFactory.getLogger(ExtendedDeploymentManager.class);
+
+ public ExtendedDeploymentManager(Collection<ModuleConfigurer> moduleConfigurers) {
+ super(moduleConfigurers);
+ }
+
+ public <T> T getImplementation(Class<T> clazz) {
+ try {
+ return kernel.getGBean(clazz);
+ } catch (GBeanNotFoundException e) {
+ throw new IllegalStateException("No implementation for " + clazz.getName(), e);
+ }
+ }
+
+ protected <T> T getImplementation(AbstractName name, Class<T> clazz) {
+ try {
+ return clazz.cast(kernel.getGBean(name));
+ } catch (GBeanNotFoundException e) {
+ throw new IllegalStateException("No implementation for " + clazz.getName(), e);
+ }
+ }
+
+ public PluginListType listPlugins(URL mavenRepository) throws FailedLoginException, IOException {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.listPlugins(mavenRepository);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public boolean validatePlugin(PluginType plugin) throws MissingDependencyException {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.validatePlugin(plugin);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public Dependency[] checkPrerequisites(PluginType plugin) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.checkPrerequisites(plugin);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public DownloadResults install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.install(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public void install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ installer.install(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password, poller);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public Object startInstall(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.startInstall(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public Object startInstall(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.startInstall(carFile, defaultRepository, restrictToDefaultRepository, username, password);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public DownloadResults checkOnInstall(Object key) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.checkOnInstall(key);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public DownloadResults checkOnInstall(Object key, boolean remove) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.checkOnInstall(key, remove);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ private PluginInstaller getPluginInstaller() {
+ return getImplementation(PluginInstaller.class);
+ }
+
+ private ServerArchiver getServerArchiver() {
+ return getImplementation(ServerArchiver.class);
+ }
+
+ public PluginListType createPluginListForRepositories(String repo) throws NoSuchStoreException {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.createPluginListForRepositories(repo);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public Map<String, Artifact> getInstalledPlugins() {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.getInstalledPlugins();
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public PluginType getPluginMetadata(Artifact configId) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.getPluginMetadata(configId);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public void updatePluginMetadata(PluginType metadata) {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ installer.updatePluginMetadata(metadata);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public URL[] getRepositories() {
+ List<URL> list = new ArrayList<URL>();
+ Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
+ for (AbstractName name : set) {
+ PluginRepositoryList repo = getImplementation(name, PluginRepositoryList.class);
+ try {
+ list.addAll(repo.getRepositories());
+ } finally {
+ kernel.getProxyManager().destroyProxy(repo);
+ }
+ }
+ return list.toArray(new URL[list.size()]);
+ }
+
+ public Artifact installLibrary(File libFile, String groupId) throws IOException {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.installLibrary(libFile, groupId);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ return installer.installPluginList(targetRepositoryPath, relativeTargetServerPath, pluginList);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException {
+ PluginInstaller installer = getPluginInstaller();
+ try {
+ installer.mergeOverrides(server, overrides);
+ } finally {
+ kernel.getProxyManager().destroyProxy(installer);
+ }
+ }
+
+ public File archive(String sourcePath, String destPath, Artifact artifact) throws IOException {
+ ServerArchiver archiver = getServerArchiver();
+ try {
+ return archiver.archive(sourcePath, destPath, artifact);
+ } finally {
+ kernel.getProxyManager().destroyProxy(archiver);
+ }
+ }
+
+}
Propchange: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/LocalDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/LocalDeploymentManager.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/LocalDeploymentManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/LocalDeploymentManager.java Thu Apr 29 05:43:39 2010
@@ -34,8 +34,10 @@ import org.apache.geronimo.kernel.Kernel
*
* @version $Rev$ $Date$
*/
-public class LocalDeploymentManager extends JMXDeploymentManager {
+public class LocalDeploymentManager extends ExtendedDeploymentManager {
+
private static final Logger log = LoggerFactory.getLogger(LocalDeploymentManager.class);
+
private static final AbstractNameQuery CONFIGURER_QUERY = new AbstractNameQuery(ModuleConfigurer.class.getName());
public LocalDeploymentManager(Kernel kernel) throws IOException {
Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Thu Apr 29 05:43:39 2010
@@ -21,13 +21,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.NetworkInterface;
-import java.net.URL;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
import javax.enterprise.deploy.shared.CommandType;
import javax.enterprise.deploy.shared.ModuleType;
@@ -37,43 +32,27 @@ import javax.enterprise.deploy.spi.statu
import javax.enterprise.deploy.spi.status.ProgressListener;
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnector;
-import javax.security.auth.login.FailedLoginException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.deployment.spi.ModuleConfigurer;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand;
import org.apache.geronimo.deployment.plugin.local.DistributeCommand;
import org.apache.geronimo.deployment.plugin.local.RedeployCommand;
import org.apache.geronimo.deployment.plugin.remote.RemoteDeployUtil;
+import org.apache.geronimo.deployment.spi.ModuleConfigurer;
import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Dependency;
-import org.apache.geronimo.kernel.repository.MissingDependencyException;
-import org.apache.geronimo.kernel.InvalidGBeanException;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
import org.apache.geronimo.system.jmx.KernelDelegate;
-import org.apache.geronimo.system.plugin.DownloadPoller;
-import org.apache.geronimo.system.plugin.DownloadResults;
-import org.apache.geronimo.system.plugin.PluginInstaller;
-import org.apache.geronimo.system.plugin.PluginRepositoryList;
-import org.apache.geronimo.system.plugin.ServerArchiver;
-//import org.apache.geronimo.system.plugin.plexus.archiver.ArchiverException;
-import org.apache.geronimo.system.plugin.model.PluginListType;
-import org.apache.geronimo.system.plugin.model.PluginType;
-import org.apache.geronimo.system.plugin.model.AttributesType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Connects to a Kernel in a remote VM (may or many not be on the same machine).
*
* @version $Rev$ $Date$
*/
-public class RemoteDeploymentManager extends JMXDeploymentManager implements GeronimoDeploymentManager, ServerArchiver {
+public class RemoteDeploymentManager extends ExtendedDeploymentManager {
private static final Logger log = LoggerFactory.getLogger(RemoteDeploymentManager.class);
private JMXConnector jmxConnector;
@@ -133,7 +112,13 @@ public class RemoteDeploymentManager ext
throw (IllegalStateException) new IllegalStateException("Unable to close connection").initCause(e);
}
}
+
+ @Override
+ protected <T> T getImplementation(AbstractName name, Class<T> clazz) {
+ return kernel.getProxyManager().createProxy(name, clazz);
+ }
+ @Override
protected DistributeCommand createDistributeCommand(Target[] targetList, File moduleArchive, File deploymentPlan) {
if (isSameMachine) {
return super.createDistributeCommand(targetList, moduleArchive, deploymentPlan);
@@ -143,6 +128,7 @@ public class RemoteDeploymentManager ext
}
}
+ @Override
protected DistributeCommand createDistributeCommand(Target[] targetList, ModuleType moduleType, InputStream moduleArchive, InputStream deploymentPlan) {
if (isSameMachine) {
return super.createDistributeCommand(targetList, moduleType, moduleArchive, deploymentPlan);
@@ -152,6 +138,7 @@ public class RemoteDeploymentManager ext
}
}
+ @Override
protected RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan) {
if (isSameMachine) {
return super.createRedeployCommand(moduleIDList, moduleArchive, deploymentPlan);
@@ -161,6 +148,7 @@ public class RemoteDeploymentManager ext
}
}
+ @Override
protected RedeployCommand createRedeployCommand(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) {
if (isSameMachine) {
return super.createRedeployCommand(moduleIDList, moduleArchive, deploymentPlan);
@@ -170,73 +158,9 @@ public class RemoteDeploymentManager ext
}
}
- public <T> T getImplementation(Class<T> clazz) {
- try {
- return kernel.getGBean(clazz);
- } catch (GBeanNotFoundException e) {
- throw new IllegalStateException("No implementation for " + clazz.getName(), e);
- }
- }
-
-
-
- public PluginListType listPlugins(URL mavenRepository) throws FailedLoginException, IOException {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.listPlugins(mavenRepository);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public boolean validatePlugin(PluginType plugin) throws MissingDependencyException {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.validatePlugin(plugin);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public Dependency[] checkPrerequisites(PluginType plugin) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.checkPrerequisites(plugin);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
-
- public DownloadResults install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.install(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public void install(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password, DownloadPoller poller) {
- PluginInstaller installer = getPluginInstaller();
- try {
- installer.install(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password, poller);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public Object startInstall(PluginListType configsToInstall, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.startInstall(configsToInstall, defaultRepository, restrictToDefaultRepository, username, password);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
+ @Override
public Object startInstall(File carFile, String defaultRepository, boolean restrictToDefaultRepository, String username, String password) {
- File[] args = new File[]{carFile};
+ File[] args = new File[] {carFile};
if (!isSameMachine) {
AbstractDeployCommand progress = new AbstractDeployCommand(CommandType.DISTRIBUTE, kernel, null, null, null,
null, null, false) {
@@ -251,92 +175,14 @@ public class RemoteDeploymentManager ext
progress.setCommandContext(commandContext);
RemoteDeployUtil.uploadFilesToServer(args, progress);
}
- PluginInstaller installer = getPluginInstaller();
- try {
- // make sure to pass args[0] as RemoteDeployUtil.uploadFilesToServer will update
- // the args argument with the filenames returned from the server
- return installer.startInstall(args[0], defaultRepository, restrictToDefaultRepository, username, password);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public DownloadResults checkOnInstall(Object key) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.checkOnInstall(key);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public DownloadResults checkOnInstall(Object key, boolean remove) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.checkOnInstall(key, remove);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- private PluginInstaller getPluginInstaller() {
- return getImplementation(PluginInstaller.class);
- }
- private ServerArchiver getServerArchiver() {
- return getImplementation(ServerArchiver.class);
- }
-
- //not likely to be useful remotely
- public PluginListType createPluginListForRepositories(String repo) throws NoSuchStoreException {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.createPluginListForRepositories(repo);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public Map getInstalledPlugins() {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.getInstalledPlugins();
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public PluginType getPluginMetadata(Artifact configId) {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.getPluginMetadata(configId);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public void updatePluginMetadata(PluginType metadata) {
- PluginInstaller installer = getPluginInstaller();
- try {
- installer.updatePluginMetadata(metadata);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public URL[] getRepositories() {
- List<URL> list = new ArrayList<URL>();
- Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
- for (AbstractName name : set) {
- PluginRepositoryList repo = (PluginRepositoryList) kernel.getProxyManager().createProxy(name,
- PluginRepositoryList.class);
- list.addAll(repo.getRepositories());
- kernel.getProxyManager().destroyProxy(repo);
- }
- return list.toArray(new URL[list.size()]);
+ // make sure to pass args[0] as RemoteDeployUtil.uploadFilesToServer will update
+ // the args argument with the filenames returned from the server
+ return super.startInstall(args[0], defaultRepository, restrictToDefaultRepository, username, password);
}
+ @Override
public Artifact installLibrary(File libFile, String groupId) throws IOException {
- File[] args = new File[]{libFile};
+ File[] args = new File[] {libFile};
if(!isSameMachine) {
AbstractDeployCommand progress = new AbstractDeployCommand(CommandType.DISTRIBUTE, kernel, null, null, null, null, null, false) {
public void run() {
@@ -350,44 +196,9 @@ public class RemoteDeploymentManager ext
progress.setCommandContext(commandContext);
RemoteDeployUtil.uploadFilesToServer(args, progress);
}
- Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
- for (AbstractName name : set) {
- PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
- // make sure to pass args[0] as RemoteDeployUtil.uploadFilesToServer will update
- // the args argument with the filenames returned from the server
- Artifact artifact = installer.installLibrary(args[0], groupId);
- kernel.getProxyManager().destroyProxy(installer);
- return artifact;
- }
- return null;
- }
-
- public DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception {
- PluginInstaller installer = getPluginInstaller();
- try {
- return installer.installPluginList(targetRepositoryPath, relativeTargetServerPath, pluginList);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException {
- PluginInstaller installer = getPluginInstaller();
- try {
- installer.mergeOverrides(server, overrides);
- } finally {
- kernel.getProxyManager().destroyProxy(installer);
- }
- }
-
- public File archive(String sourcePath, String destPath, Artifact artifact) throws //ArchiverException,
- IOException {
- ServerArchiver archiver = getServerArchiver();
- try {
- return archiver.archive(sourcePath, destPath, artifact);
- } finally {
- kernel.getProxyManager().destroyProxy(archiver);
- }
+ // make sure to pass args[0] as RemoteDeployUtil.uploadFilesToServer will update
+ // the args argument with the filenames returned from the server
+ return super.installLibrary(args[0], groupId);
}
public static final GBeanInfo GBEAN_INFO;
Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java Thu Apr 29 05:43:39 2010
@@ -212,10 +212,11 @@ public class Bootstrapper {
String[] parts = location.split("/");
File fileLocation = getBundleLocation(parts);
- if (location == null) {
+ if (fileLocation == null) {
System.err.println("Artifact " + location + " not found");
continue;
}
+
parts[2] = fileLocation.getParentFile().getName();
parts[3] = fileLocation.getName().substring(fileLocation.getName().lastIndexOf('.') + 1);
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/cluster/ClusterCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/cluster/ClusterCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/cluster/ClusterCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/cluster/ClusterCommand.java Thu Apr 29 05:43:39 2010
@@ -17,13 +17,8 @@
* under the License.
*/
-
package org.apache.geronimo.shell.cluster;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.IOException;
-
import java.util.Map;
import javax.enterprise.deploy.spi.DeploymentManager;
@@ -31,23 +26,19 @@ import javax.enterprise.deploy.spi.Deplo
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.felix.gogo.commands.Option;
-
import org.apache.geronimo.deployment.cli.CommandInstallCAR;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.CommandListConfigurations;
-import org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager;
+import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.shell.deploy.ConnectCommand;
-import org.apache.geronimo.system.plugin.Farm;
import org.apache.geronimo.system.plugin.DownloadResults;
-
-import org.osgi.service.command.CommandSession;
+import org.apache.geronimo.system.plugin.Farm;
/**
* @version $Rev$ $Date$
*/
-
@Command(scope = "geronimo", name = "cluster", description = "administer cluster")
public class ClusterCommand extends ConnectCommand {
+
@Option(name="-c", aliases={"--cluster"}, description="Cluster to perform action on")
String clusterName;
@@ -71,7 +62,7 @@ public class ClusterCommand extends Conn
protected Object doExecute(ServerConnection connection) throws Exception {
DeploymentManager deploymentManager = connection.getDeploymentManager();
- Farm farm = (Farm)((RemoteDeploymentManager)deploymentManager).getImplementation(Farm.class);
+ Farm farm = (Farm)((GeronimoDeploymentManager)deploymentManager).getImplementation(Farm.class);
Map<String, DownloadResults> results;
if (action == "add") {
if (clusterName != null && pluginList != null && plugin != null) {
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DeployModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DeployModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DeployModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DeployModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -17,10 +17,8 @@
* under the License.
*/
-
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;
@@ -30,9 +28,8 @@ import org.apache.felix.gogo.commands.Op
import org.apache.geronimo.cli.deployer.DistributeCommandArgs;
import org.apache.geronimo.cli.deployer.DistributeCommandArgsImpl;
import org.apache.geronimo.deployment.cli.CommandDeploy;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -56,7 +53,6 @@ public class DeployModuleCommand extends
ServerConnection connection = connect();
CommandDeploy command = new CommandDeploy();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
List<String> commandArgs = new LinkedList<String>();
commandArgs.add(module);
@@ -67,7 +63,7 @@ public class DeployModuleCommand extends
DistributeCommandArgs args = new DistributeCommandArgsImpl(commandArgs.toArray(new String[commandArgs.size()]));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DistributeCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DistributeCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DistributeCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/DistributeCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;
@@ -28,9 +27,8 @@ import org.apache.felix.gogo.commands.Co
import org.apache.felix.gogo.commands.Option;
import org.apache.geronimo.cli.deployer.DistributeCommandArgs;
import org.apache.geronimo.deployment.cli.CommandDistribute;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -54,7 +52,6 @@ public class DistributeCommand extends C
ServerConnection connection = connect();
CommandDistribute command = new CommandDistribute();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
List<String> commandArgs = new LinkedList<String>();
commandArgs.add(module);
@@ -66,7 +63,7 @@ public class DistributeCommand extends C
DistributeCommandArgs args = new DistributeCommandArgsImpl(commandArgs.toArray(new String[commandArgs.size()]),
(targets == null ? new String[0] : targets.split(";")), inPlace);
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/EncryptCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/EncryptCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/EncryptCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/EncryptCommand.java Thu Apr 29 05:43:39 2010
@@ -19,16 +19,12 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandEncrypt;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
@Command(scope = "deploy", name = "encrypt", description = "Encrypt strings")
public class EncryptCommand extends ConnectCommand{
@@ -42,11 +38,9 @@ public class EncryptCommand extends Conn
AbstractCommand command = new CommandEncrypt();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(message.split(" "));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallLibraryCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallLibraryCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallLibraryCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallLibraryCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.Arrays;
import org.apache.felix.gogo.commands.Argument;
@@ -27,9 +26,7 @@ import org.apache.felix.gogo.commands.Co
import org.apache.felix.gogo.commands.Option;
import org.apache.geronimo.cli.deployer.InstallLibraryCommandArgs;
import org.apache.geronimo.deployment.cli.CommandInstallLibrary;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
/**
* @version $Rev$ $Date$
@@ -49,12 +46,10 @@ public class InstallLibraryCommand exten
CommandInstallLibrary command = new CommandInstallLibrary();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
InstallLibraryCommandArgs args = new InstallLibraryCommandArgsImpl(Arrays.asList(libraryFile).toArray(
new String[1]), groupId);
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallPluginCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallPluginCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallPluginCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/InstallPluginCommand.java Thu Apr 29 05:43:39 2010
@@ -19,15 +19,12 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.CommandInstallCAR;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -43,11 +40,9 @@ public class InstallPluginCommand extend
CommandInstallCAR command = new CommandInstallCAR();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(pluginFile.split(""));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListModulesCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListModulesCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListModulesCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListModulesCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.List;
import org.apache.felix.gogo.commands.Argument;
@@ -28,9 +27,8 @@ import org.apache.felix.gogo.commands.Op
import org.apache.geronimo.cli.deployer.ListModulesCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandListModules;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -55,12 +53,10 @@ public class ListModulesCommand extends
AbstractCommand command = new CommandListModules();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
ListModulesCommandArgs args = new ListModulesCommandArgsImpl((targets == null ? new String[0]
: (String[]) targets.toArray()), all, started, stopped);
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListPluginsCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListPluginsCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListPluginsCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListPluginsCommand.java Thu Apr 29 05:43:39 2010
@@ -19,18 +19,16 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.List;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.felix.gogo.commands.Option;
import org.apache.geronimo.deployment.cli.CommandListConfigurations;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.system.plugin.model.PluginListType;
+
/**
* @version $Rev$ $Date$
*/
@@ -54,20 +52,20 @@ public class ListPluginsCommand extends
ServerConnection connection = connect();
CommandListConfigurations command = new CommandListConfigurations();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
+
String repo = null;
PluginListType plugins = null;
if (mavenRepoURL != null) {
plugins = command.getPluginCategories(mavenRepoURL, (GeronimoDeploymentManager) connection
- .getDeploymentManager(), consoleReader);
+ .getDeploymentManager(), this);
repo = mavenRepoURL;
} else {
println("Listing configurations from Geronimo server");
repo = (String) session.get("PluginRepository");
if (refreshRepo || repo == null) {
- repo = command.getRepository(consoleReader, (GeronimoDeploymentManager) connection
+ repo = command.getRepository(this, (GeronimoDeploymentManager) connection
.getDeploymentManager());
session.put("PluginRepository", repo);
}
@@ -75,7 +73,7 @@ public class ListPluginsCommand extends
plugins = (PluginListType) session.get("AvailablePlugins");
if (refreshList || plugins == null) {
plugins = command.getPluginCategories(repo, (GeronimoDeploymentManager) connection
- .getDeploymentManager(), consoleReader);
+ .getDeploymentManager(), this);
session.put("AvailablePlugins", plugins);
}
}
@@ -83,13 +81,13 @@ public class ListPluginsCommand extends
if (plugins != null) {
if (pluginArtifacts != null) {
command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(), pluginArtifacts,
- plugins, repo, consoleReader, connection);
+ plugins, repo, this, connection);
} else {
- PluginListType pluginsToInstall = command.getInstallList(plugins, consoleReader, repo);
+ PluginListType pluginsToInstall = command.getInstallList(plugins, this, repo);
if (pluginsToInstall != null) {
command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(),
- pluginsToInstall, repo, consoleReader, connection);
+ pluginsToInstall, repo, this, connection);
}
}
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListTargetsCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListTargetsCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListTargetsCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/ListTargetsCommand.java Thu Apr 29 05:43:39 2010
@@ -19,15 +19,12 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandListTargets;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -39,10 +36,10 @@ public class ListTargetsCommand extends
ServerConnection connection = connect();
AbstractCommand command = new CommandListTargets();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
+
BaseCommandArgs args = new BaseCommandArgs(new String[1]);
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/LoginCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/LoginCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/LoginCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/LoginCommand.java Thu Apr 29 05:43:39 2010
@@ -19,15 +19,12 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandLogin;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -40,11 +37,9 @@ public class LoginCommand extends Connec
AbstractCommand command = new CommandLogin();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(new String[0]);
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/NewInstanceCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/NewInstanceCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/NewInstanceCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/NewInstanceCommand.java Thu Apr 29 05:43:39 2010
@@ -19,17 +19,14 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import javax.enterprise.deploy.spi.DeploymentManager;
-import jline.ConsoleReader;
-
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager;
+import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.system.plugin.NewServerInstance;
+
/**
* @version $Rev$ $Date$
*/
@@ -43,13 +40,9 @@ public class NewInstanceCommand extends
protected Object doExecute() throws Exception {
ServerConnection connection = connect();
- ConsoleReader consoleReader = new ConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
- String repo = null;
- String plugins = null;
-
DeploymentManager deploymentManager = connection.getDeploymentManager();
- NewServerInstance newServerInstance = (NewServerInstance) ((RemoteDeploymentManager) deploymentManager)
- .getImplementation(NewServerInstance.class);
+ NewServerInstance newServerInstance =
+ (NewServerInstance) ((GeronimoDeploymentManager) deploymentManager).getImplementation(NewServerInstance.class);
newServerInstance.newServerInstance(serverName);
println("Server created");
return null;
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RedeployModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RedeployModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RedeployModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RedeployModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;
@@ -28,9 +27,8 @@ import org.apache.felix.gogo.commands.Co
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandRedeploy;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -52,8 +50,6 @@ public class RedeployModuleCommand exten
AbstractCommand command = new CommandRedeploy();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
List<String> commandArgs = new LinkedList<String>();
if (moduleName != null) {
@@ -70,7 +66,7 @@ public class RedeployModuleCommand exten
BaseCommandArgs args = new BaseCommandArgs(commandArgs.toArray(new String[commandArgs.size()]));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RestartModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RestartModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RestartModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/RestartModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.List;
import org.apache.felix.gogo.commands.Argument;
@@ -27,9 +26,8 @@ import org.apache.felix.gogo.commands.Co
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandRestart;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -45,11 +43,9 @@ public class RestartModuleCommand extend
AbstractCommand command = new CommandRestart();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(moduleNames.toArray(new String[moduleNames.size()]));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StartModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StartModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StartModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StartModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -19,16 +19,13 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandStart;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -44,11 +41,9 @@ public class StartModuleCommand extends
AbstractCommand command = new CommandStart();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(moduleNames.split(" "));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StopModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StopModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StopModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/StopModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -19,16 +19,13 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
-
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandStop;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -44,11 +41,9 @@ public class StopModuleCommand extends C
AbstractCommand command = new CommandStop();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(moduleNames.split(" "));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/UndeployModuleCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/UndeployModuleCommand.java?rev=939201&r1=939200&r2=939201&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/UndeployModuleCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/deploy/UndeployModuleCommand.java Thu Apr 29 05:43:39 2010
@@ -19,7 +19,6 @@
package org.apache.geronimo.shell.deploy;
-import java.io.PrintWriter;
import java.util.List;
import org.apache.felix.gogo.commands.Argument;
@@ -27,9 +26,8 @@ import org.apache.felix.gogo.commands.Co
import org.apache.geronimo.cli.deployer.BaseCommandArgs;
import org.apache.geronimo.deployment.cli.AbstractCommand;
import org.apache.geronimo.deployment.cli.CommandUndeploy;
-import org.apache.geronimo.deployment.cli.ConsoleReader;
import org.apache.geronimo.deployment.cli.ServerConnection;
-import org.apache.geronimo.deployment.cli.StreamConsoleReader;
+
/**
* @version $Rev$ $Date$
*/
@@ -45,11 +43,9 @@ public class UndeployModuleCommand exten
AbstractCommand command = new CommandUndeploy();
- ConsoleReader consoleReader = new StreamConsoleReader(session.getKeyboard(),new PrintWriter(session.getConsole(),true));
-
BaseCommandArgs args = new BaseCommandArgs(moduleNames.toArray(new String[moduleNames.size()]));
- command.execute(consoleReader, connection, args);
+ command.execute(this, connection, args);
return null;
}
}