Author: djencks
Date: Wed Dec 7 11:05:33 2005
New Revision: 354830
URL: http://svn.apache.org/viewcvs?rev=354830&view=rev
Log:
GERONIMO-1306, remove modules/assembly GERONIMO-1294 remove offline capability from online
deployment tool
Removed:
geronimo/trunk/modules/assembly/
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/ShutdownBootstrap.java
geronimo/trunk/modules/installer/
Modified:
geronimo/trunk/modules/deploy-tool/project.xml
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListTargets.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
Modified: geronimo/trunk/modules/deploy-tool/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/project.xml?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/project.xml (original)
+++ geronimo/trunk/modules/deploy-tool/project.xml Wed Dec 7 11:05:33 2005
@@ -41,17 +41,6 @@
<!-- ============ -->
<dependencies>
- <dependency>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- <version>${xmlbeans_version}</version>
- </dependency>
-
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>${stax_api_version}</version>
- </dependency>
<dependency>
<groupId>mx4j</groupId>
@@ -65,12 +54,25 @@
<version>${mx4j_version}</version>
</dependency>
+ <!-- plugin bootstrap only -->
+ <dependency>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean</artifactId>
+ <version>${xmlbeans_version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax_api_version}</version>
+ </dependency>
+
<!-- Module Dependencies -->
<dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-kernel</artifactId>
- <version>${pom.currentVersion}</version>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-j2ee-deployment</artifactId>
+ <version>${geronimo_spec_j2ee_deployment_version}</version>
</dependency>
<dependency>
@@ -103,23 +105,19 @@
<version>${pom.currentVersion}</version>
</dependency>
- <dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-service-builder</artifactId>
- <version>${pom.currentVersion}</version>
- </dependency>
+ <!-- for pluginBootstrap only -->
+ <dependency>
+ <groupId>geronimo</groupId>
+ <artifactId>geronimo-kernel</artifactId>
+ <version>${pom.currentVersion}</version>
+ </dependency>
<dependency>
<groupId>geronimo</groupId>
- <artifactId>geronimo-j2ee</artifactId>
+ <artifactId>geronimo-service-builder</artifactId>
<version>${pom.currentVersion}</version>
</dependency>
- <dependency>
- <groupId>geronimo-spec</groupId>
- <artifactId>geronimo-spec-j2ee-deployment</artifactId>
- <version>${geronimo_spec_j2ee_deployment_version}</version>
- </dependency>
</dependencies>
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
Wed Dec 7 11:05:33 2005
@@ -19,12 +19,11 @@
import org.apache.geronimo.common.DeploymentException;
-import javax.enterprise.deploy.spi.status.ProgressObject;
import javax.enterprise.deploy.spi.DeploymentManager;
import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import java.io.PrintWriter;
+import javax.enterprise.deploy.spi.status.ProgressObject;
import java.io.File;
+import java.io.PrintWriter;
/**
* The CLI deployer logic to deploy (distribute plus start).
@@ -60,9 +59,6 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
super.execute(out, connection, args);
}
}
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Wed Dec 7 11:05:33 2005
@@ -17,18 +17,17 @@
package org.apache.geronimo.deployment.cli;
+import org.apache.geronimo.common.DeploymentException;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
-
-import org.apache.geronimo.common.DeploymentException;
/**
* The CLI deployer logic to distribute.
@@ -70,9 +69,6 @@
}
List targets = new ArrayList();
args = processTargets(args, targets);
- if(targets.size() > 0 && !connection.isOnline()) {
- throw new DeploymentSyntaxException("Cannot specify targets unless connecting
to a running server. Specify --url if server is not running on the default port on localhost.");
- }
if(args.length > 2) {
throw new DeploymentSyntaxException("Too many arguments");
}
@@ -112,19 +108,7 @@
if(plan != null) {
plan = plan.getAbsoluteFile();
}
- if(connection.isOnline()) {
- executeOnline(connection, targets, out, module, plan);
- } else {
- executeOffline(connection, out, module, plan);
- }
- }
-
- private void executeOffline(ServerConnection connection, PrintWriter out, File module,
File plan) throws DeploymentException {
- List list = (List)connection.invokeOfflineDeployer(new Object[]{module, plan},
- new String[]{File.class.getName(), File.class.getName()});
- for(Iterator it = list.iterator(); it.hasNext();) {
- out.println(getAction()+" "+it.next());
- }
+ executeOnline(connection, targets, out, module, plan);
}
private void executeOnline(ServerConnection connection, List targets, PrintWriter out,
File module, File plan) throws DeploymentException {
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
Wed Dec 7 11:05:33 2005
@@ -43,9 +43,6 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
List targets = new ArrayList();
Boolean started = null;
for (int i = 0; i < args.length; i++) {
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListTargets.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListTargets.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListTargets.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListTargets.java
Wed Dec 7 11:05:33 2005
@@ -19,8 +19,8 @@
import org.apache.geronimo.common.DeploymentException;
-import java.io.PrintWriter;
import javax.enterprise.deploy.spi.Target;
+import java.io.PrintWriter;
/**
* The CLI deployer logic to list targets.
@@ -36,9 +36,6 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
Target[] list = connection.getDeploymentManager().getTargets();
out.println("Available Targets:");
for(int i = 0; i < list.length; i++) {
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandLogin.java
Wed Dec 7 11:05:33 2005
@@ -58,9 +58,6 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
try {
File authFile = new File(System.getProperty("user.home"), ".geronimo-deployer");
if(!authFile.exists()) {
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
Wed Dec 7 11:05:33 2005
@@ -1,171 +0,0 @@
-/**
- *
- * Copyright 2003-2004 The Apache Software Foundation
- *
- * Licensed 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.cli;
-
-import org.apache.geronimo.common.DeploymentException;
-
-import java.io.PrintWriter;
-import java.io.File;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
-import java.util.Arrays;
-
-/**
- * The CLI deployer logic to create a configuration package. Can only be run
- * in ofline mode (not via JSR-88).
- *
- * @version $Rev: 53762 $ $Date: 2004-10-04 18:54:53 -0400 (Mon, 04 Oct 2004) $
- */
-public class CommandPackage extends AbstractCommand {
- public CommandPackage() {
- super("package", "3. Use if you know what you're doing", "[--classPath path] [--mainClass
class] [--install] [module] [plan] fileName",
- "Creates a configuration JAR rather than installing into the server " +
- "environment. The fileName argument specifies the JAR to create. The "
+
- "optional classPath argument specifies a Class-Path to include in the JAR
" +
- "manifest. The optional mainClass argument specifies the Main-Class to include
in " +
- "the JAR manifest. The install option specifies that the " +
- "configuration should be build into a JAR and also installed into " +
- "the server configuration (otherwise it is packaged but not installed).\n"
+
- "The standard arguments may not be used with this command -- it " +
- "never connects to a remote server.");
- }
-
- public boolean isLocalOnly() {
- return true;
- }
-
- public void execute(PrintWriter out, ServerConnection connection, String[] argArray)
throws DeploymentException {
- if (connection.isOnline()) {
- throw new DeploymentException("This command cannot be run when the server is
running. Make sure the server is shut down first.");
- }
-
- String classPath = null;
- String mainClass = null;
- String endorsedDirs = null;
- String extensionDirs = null;
- boolean install = false;
-
- // Read off the optional arguments (clasPath, mainClass, endorsedDirs, and install)
- LinkedList args = new LinkedList(Arrays.asList(argArray));
- for (Iterator iterator = args.iterator(); iterator.hasNext();) {
- String arg = (String) iterator.next();
- if (arg.equals("--classPath")) {
- iterator.remove();
- classPath = (String) iterator.next();
- iterator.remove();
- } else if (arg.equals("--mainClass")) {
- iterator.remove();
- mainClass = (String) iterator.next();
- iterator.remove();
- } else if (arg.equals("--endorsedDirs")) {
- iterator.remove();
- endorsedDirs = (String) iterator.next();
- iterator.remove();
- } else if (arg.equals("--extensionDirs")) {
- iterator.remove();
- extensionDirs = (String) iterator.next();
- iterator.remove();
- } else if (arg.equals("--install")) {
- iterator.remove();
- install = true;
- } else if (arg.startsWith("--")) {
- throw new DeploymentSyntaxException("Invalid option '" + arg + "'");
- } else {
- break;
- }
- }
-
- // if we have any other options on the comman line they are invalid
- for (Iterator iterator = args.iterator(); iterator.hasNext();) {
- String arg = (String) iterator.next();
- if (arg.startsWith("--")) {
- throw new DeploymentSyntaxException("All command line options must appear
before module, plan or packageFile: " + arg);
- }
- }
-
- if (args.isEmpty()) {
- throw new DeploymentSyntaxException("No fileName specified for package command");
- }
-
- // Read off packageFile which is always the last argument
- File packageFile;
- packageFile = new File((String) args.removeLast());
- File parent = packageFile.getAbsoluteFile().getParentFile();
- if (!parent.exists() || !parent.canWrite()) {
- throw new DeploymentSyntaxException("Cannot write to output file " + packageFile.getAbsolutePath());
- }
-
- // Read off the plan and module
- File module = null;
- File plan = null;
- if (!args.isEmpty()) {
- // if the arg is a directory or jar file, it must be the module; otherwise it
is the plan
- File test = new File((String) args.removeLast()).getAbsoluteFile();
- if (DeployUtils.isJarFile(test) || test.isDirectory()) {
- module = test;
- } else {
- plan = test;
- }
- }
- if (!args.isEmpty()) {
- File test = new File((String) args.removeLast()).getAbsoluteFile();
- if (DeployUtils.isJarFile(test) || test.isDirectory()) {
- if (module != null) {
- throw new DeploymentSyntaxException("Module and plan cannot both be JAR
files or directories!");
- }
- module = test;
- } else {
- if (plan != null) {
- throw new DeploymentSyntaxException("Module or plan must be a JAR file
or directory!");
- }
- plan = test;
- }
- }
-
- // are there extra left over args on the command prompt
- if (!args.isEmpty()) {
- throw new DeploymentSyntaxException("Too many arguments for package command");
- }
-
- // invoke the deployer
- List list = (List) connection.invokeOfflineDeployer(new Object[]{
- plan,
- module,
- packageFile,
- install ? Boolean.TRUE : Boolean.FALSE,
- mainClass,
- classPath,
- endorsedDirs,
- extensionDirs},
- new String[]{
- File.class.getName(),
- File.class.getName(),
- File.class.getName(),
- boolean.class.getName(),
- String.class.getName(),
- String.class.getName(),
- String.class.getName(),
- String.class.getName()});
-
- // print the configurations created
- for (int j = 0; j < list.size(); j++) {
- out.println("Packaged configuration " + list.get(j) + " to " + packageFile);
- }
- }
-}
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
Wed Dec 7 11:05:33 2005
@@ -18,14 +18,17 @@
package org.apache.geronimo.deployment.cli;
import org.apache.geronimo.common.DeploymentException;
-import java.io.*;
-import java.util.List;
-import java.util.ArrayList;
+
import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.TargetModuleID;
import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
import javax.enterprise.deploy.spi.exceptions.TargetException;
import javax.enterprise.deploy.spi.status.ProgressObject;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
/**
* The CLI deployer logic to redeploy.
@@ -55,9 +58,6 @@
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
setOut(out);
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
if(args.length == 0) {
throw new DeploymentSyntaxException("Must specify a module or plan (or both)
and optionally module IDs to replace");
}
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
Wed Dec 7 11:05:33 2005
@@ -19,14 +19,14 @@
import org.apache.geronimo.common.DeploymentException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import javax.enterprise.deploy.spi.TargetModuleID;
import javax.enterprise.deploy.spi.DeploymentManager;
import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
import javax.enterprise.deploy.spi.exceptions.TargetException;
import javax.enterprise.deploy.spi.status.ProgressObject;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
/**
* The CLI deployer logic to start.
@@ -50,9 +50,6 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws
DeploymentException {
- if(!connection.isOnline()) {
- throw new DeploymentException("This command cannot be run unless connecting to
a running server. Specify --url if server is not running on the default port on localhost.");
- }
if(args.length == 0) {
throw new DeploymentSyntaxException("Must specify at least one module name or
TargetModuleID");
}
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
Wed Dec 7 11:05:33 2005
@@ -70,7 +70,6 @@
registerCommand(new CommandDistribute());
registerCommand(new CommandListModules());
registerCommand(new CommandListTargets());
- registerCommand(new CommandPackage());
registerCommand(new CommandRedeploy());
registerCommand(new CommandStart());
registerCommand(new CommandStop());
@@ -151,7 +150,7 @@
} else {
try {
if(con == null) {
- con = new ServerConnection(generalArgs, dc.isLocalOnly(), out, in);
+ con = new ServerConnection(generalArgs, out, in);
}
try {
dc.execute(out, con, commandArgs);
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Wed Dec 7 11:05:33 2005
@@ -17,19 +17,6 @@
package org.apache.geronimo.deployment.cli;
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.plugin.factories.AuthenticationFailedException;
-import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
-import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager;
-import org.apache.geronimo.system.main.CommandLine;
-import org.apache.geronimo.system.main.CommandLineManifest;
-import org.apache.geronimo.util.SimpleEncryption;
-
-import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
-import javax.enterprise.deploy.spi.factories.DeploymentFactory;
-import javax.management.ObjectName;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
@@ -43,12 +30,20 @@
import java.util.Map;
import java.util.Properties;
import java.util.jar.JarFile;
+import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.plugin.factories.AuthenticationFailedException;
+import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
+import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager;
+import org.apache.geronimo.util.SimpleEncryption;
/**
- * Supports two types of connections to the server. One, via JSR-88, is valid
- * whenever the server is online, for any command except "package". The other,
- * via direct Kernel invocation, is valid when the server is not running for
- * only the commands "distribute" and "package".
+ * Supports online connections to the server, via JSR-88, valid only
+ * when the server is online.
*
* @version $Rev: 53762 $ $Date: 2004-10-04 18:54:53 -0400 (Mon, 04 Oct 2004) $
*/
@@ -63,13 +58,6 @@
"not compatible with --uri, but is often used with --port.");
OPTION_HELP.put("--port", "The RMI listen port of a Geronimo server to deploy to.
This option is " +
"not compatible with --uri, but is often used with --host. The default port
is 1099.");
- OPTION_HELP.put("--offline", "Indicates that you don't want the deployer to try to
connect to " +
- "a Geronimo server over the network. If you're running on the same machine
as the " +
- "Geronimo installation, using this option means that you're asserting that
the" +
- "Geronimo server is not running. WARNING: do not use this option if there's
a Geronimo " +
- "server running out of the same Geronimo installation as the deploy tool
is from --" +
- "the results may be unexpected. Further, only a small number of commands
may be" +
- "run in offline mode.");
OPTION_HELP.put("--driver", "If you want to use this tool with a server other than
Geronimo, " +
"then you must provide the path to its driver JAR. Currently, manifest "
+
"Class-Path entries in that JAR are ignored.");
@@ -88,9 +76,8 @@
/**
* Checks whether the stated command-line argument is a general argument (which
* may be the general argument itself, or a required parameter after the general
- * argument). For example, if the arguments were "--user bob --offline foo" then
- * this should return true for "--user" "bob" and "--offline" and false for "foo"
- * (since --offline does not expect a parameter).
+ * argument). For example, if the arguments were "--user bob foo" then
+ * this should return true for "--user" and "bob" and false for "foo".
*
* @param args The previous arguments on the command line
* @param option The argument we're checking at the moment
@@ -110,19 +97,17 @@
}
private final static String DEFAULT_URI = "deployer:geronimo:jmx";
-
+
private DeploymentManager manager;
- private KernelWrapper kernel;
private PrintWriter out;
private BufferedReader in;
private SavedAuthentication auth;
private boolean logToSysErr;
private boolean verboseMessages;
- public ServerConnection(String[] args, boolean forceLocal, PrintWriter out, BufferedReader
in) throws DeploymentException {
+ public ServerConnection(String[] args, PrintWriter out, BufferedReader in) throws DeploymentException
{
String uri = null, driver = null, user = null, password = null, host = null;
Integer port = null;
- boolean offline = false;
this.out = out;
this.in = in;
for(int i = 0; i < args.length; i++) {
@@ -133,9 +118,6 @@
} else if(i >= args.length-1) {
throw new DeploymentSyntaxException("Must specify a URI (e.g. --uri deployer:...)");
}
- if(offline) {
- throw new DeploymentSyntaxException("Cannot specify a URI in offline
mode");
- }
if(host != null || port != null) {
throw new DeploymentSyntaxException("Cannot specify a URI as well as
a host/port");
}
@@ -170,33 +152,15 @@
} else if(i >= args.length-1) {
throw new DeploymentSyntaxException("Must specify a driver JAR (--driver
jarfile)");
}
- if(offline) {
- throw new DeploymentSyntaxException("Cannot specify a driver in offline
mode");
- }
driver = args[++i];
} else if(arg.equals("--offline")) {
- if(uri != null) {
- throw new DeploymentSyntaxException("Cannot specify a URI in offline
mode");
- }
- if(driver != null) {
- throw new DeploymentSyntaxException("Cannot specify a driver in offline
mode");
- }
- if(user != null) {
- throw new DeploymentSyntaxException("Cannot specify a username in offline
mode");
- }
- if(password != null) {
- throw new DeploymentSyntaxException("Cannot specify a password in offline
mode");
- }
- offline = true;
+ throw new DeploymentSyntaxException("This tool no longer handles offline
deployment");
} else if(arg.equals("--user")) {
if(user != null) {
throw new DeploymentSyntaxException("Cannot specify more than one user
name");
} else if(i >= args.length-1) {
throw new DeploymentSyntaxException("Must specify a username (--user
username)");
}
- if(offline) {
- throw new DeploymentSyntaxException("Cannot specify a username in offline
mode");
- }
user = args[++i];
} else if(arg.equals("--password")) {
if(password != null) {
@@ -204,9 +168,6 @@
} else if(i >= args.length-1) {
throw new DeploymentSyntaxException("Must specify a password (--password
password)");
}
- if(offline) {
- throw new DeploymentSyntaxException("Cannot specify a password in offline
mode");
- }
password = args[++i];
} else if (arg.equals("--verbose")) {
verboseMessages = true;
@@ -219,40 +180,19 @@
if((driver != null) && uri == null) {
throw new DeploymentSyntaxException("A custom driver requires a custom URI");
}
- if(forceLocal && !offline) {
- throw new DeploymentSyntaxException("This command may only be run offline. Make
sure the server is not running and use the --offline option.");
- }
- if(forceLocal && (uri != null || driver != null || user != null || password
!= null || host != null || port != null)) {
- throw new DeploymentSyntaxException("This command does not use normal server
connectivity. No standard options are allowed.");
- }
if(host != null || port != null) {
uri = DEFAULT_URI+"://"+(host == null ? "" : host)+(port == null ? "" : ":"+port);
}
- if(forceLocal || offline) {
- initializeKernel();
- } else {
- tryToConnect(uri, driver, user, password, true);
- if(manager == null) {
- throw new DeploymentException("Unexpected error; connection failed.");
- }
+ tryToConnect(uri, driver, user, password, true);
+ if(manager == null) {
+ throw new DeploymentException("Unexpected error; connection failed.");
}
}
- private void initializeKernel() throws DeploymentException {
- if(kernel != null) {
- throw new IllegalStateException("Kernel is already running!");
- }
- kernel = new KernelWrapper();
- kernel.start();
- }
-
public void close() throws DeploymentException {
if(manager != null) {
manager.release();
}
- if(kernel != null) {
- kernel.stop();
- }
}
Serializable getAuthentication() {
@@ -309,7 +249,7 @@
} else { // Standard URI with no auth, Non-standard URI with auth, or else this is
the 2nd try already
try {
manager = mgr.getDeploymentManager(useURI, user, password);
- auth = new SavedAuthentication(useURI, user, password.toCharArray());
+ auth = new SavedAuthentication(useURI, user, password == null ? null : password.toCharArray());
} catch(AuthenticationFailedException e) { // server's there, you just can't
talk to it
if(authPrompt) {
doAuthPromptAndRetry(useURI, user, password);
@@ -370,57 +310,10 @@
return manager;
}
- public boolean isOnline() {
- return manager != null;
- }
-
public boolean isGeronimo() {
- return isOnline() && manager.getClass().getName().startsWith("org.apache.geronimo.");
- }
-
- public Object invokeOfflineDeployer(Object[] args, String[] argTypes) throws DeploymentException
{
- if(kernel == null) {
- throw new IllegalStateException("Cannot attempt to package when no local kernel
is available");
- }
- return kernel.invoke(args, argTypes);
+ return manager.getClass().getName().startsWith("org.apache.geronimo.");
}
- private static class KernelWrapper extends CommandLine {
- private ObjectName mainGbean;
- private String mainMethod;
- private List configurations;
-
- public KernelWrapper() {
- CommandLineManifest entries = CommandLineManifest.getManifestEntries();
- configurations = entries.getConfigurations();
- mainGbean = entries.getMainGBean();
- mainMethod = entries.getMainMethod();
- }
-
- public Object invoke(Object[] args, String[] argTypes) throws DeploymentException
{
- try {
- return getKernel().invoke(mainGbean, mainMethod, args, argTypes);
- } catch(Exception e) {
- throw new DeploymentException("Unable to connect to local deployer service",
e);
- }
- }
-
- public void start() throws DeploymentException {
- try {
- super.startKernel(configurations);
- } catch(Exception e) {
- throw new DeploymentException("Unable to start local kernel", e);
- }
- }
-
- public void stop() throws DeploymentException {
- try {
- super.stopKernel();
- } catch(Exception e) {
- throw new DeploymentException("Unable to stop local kernel", e);
- }
- }
- }
/**
* Prompts for and grabs a password, trying to suppress any console output
Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java?rev=354830&r1=354829&r2=354830&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
Wed Dec 7 11:05:33 2005
@@ -125,7 +125,7 @@
private boolean argumentHasValue(int i) {
return i + 1 < args.length && !args[i + 1].startsWith("--");
}
-
+
private boolean setParam(int i) {
if (argumentHasValue(i)) {
if (args[i].equals("--user")) {
|