jboynes 2004/02/21 12:20:44
Modified: modules/deployment/src/java/org/apache/geronimo/deployment
Deployer.java
Log:
Pass unpacked modules through to builders
Revision Changes Path
1.10 +34 -34
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Index: Deployer.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Deployer.java 21 Feb 2004 20:03:24 -0000 1.9
+++ Deployer.java 21 Feb 2004 20:20:44 -0000 1.10
@@ -142,48 +142,48 @@
throw new DeploymentException("No plan or module supplied");
}
- JarInputStream moduleStream;
- if (cmd.module != null) {
- try {
- moduleStream = new JarInputStream(cmd.module.openStream());
- } catch (IOException e) {
- throw new DeploymentException("Unable to open module", e);
- }
+ boolean saveOutput;
+ if (cmd.carfile == null) {
+ saveOutput = false;
+ cmd.carfile = File.createTempFile("deployer", ".car");
} else {
- moduleStream = null;
+ saveOutput = true;
}
-
try {
- boolean saveOutput;
- if (cmd.carfile == null) {
- saveOutput = false;
- cmd.carfile = File.createTempFile("deployer", ".car");
+ if (cmd.module == null) {
+ builder.buildConfiguration(cmd.carfile, (JarInputStream)
null, plan);
+ } else if ("file".equals(cmd.module.getProtocol())) {
+ File module = new File(cmd.module.getPath());
+ builder.buildConfiguration(cmd.carfile, module, plan);
+ } else if (cmd.module.toString().endsWith("/")) {
+ throw new DeploymentException("Unpacked modules must be
files");
} else {
- saveOutput = true;
- }
- try {
- builder.buildConfiguration(cmd.carfile, moduleStream, plan);
-
+ JarInputStream moduleStream = new
JarInputStream(cmd.module.openStream());
try {
- if (cmd.install) {
- kernel.install(cmd.carfile.toURL());
+ builder.buildConfiguration(cmd.carfile, moduleStream,
plan);
+ } finally {
+ try {
+ moduleStream.close();
+ } catch (IOException e) {
+ // ignore
}
- } catch (InvalidConfigException e) {
- // unlikely as we just built this
- throw new DeploymentException(e);
}
- } finally {
- if (!saveOutput) {
- cmd.carfile.delete();
+ }
+
+ try {
+ if (cmd.install) {
+ kernel.install(cmd.carfile.toURL());
}
+ } catch (InvalidConfigException e) {
+ // unlikely as we just built this
+ throw new DeploymentException(e);
}
+ } catch (Exception e) {
+ saveOutput = false;
+ throw e;
} finally {
- if (moduleStream != null) {
- try {
- moduleStream.close();
- } catch (IOException e) {
- // ignore to allow cause through
- }
+ if (!saveOutput) {
+ cmd.carfile.delete();
}
}
}