jboynes 2004/02/20 08:18:14
Modified: modules/deployment/src/java/org/apache/geronimo/deployment
DeploymentContext.java
Log:
Allow access to configID
Provide way to add the content of an archive
Revision Changes Path
1.2 +16 -3
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
Index: DeploymentContext.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DeploymentContext.java 12 Feb 2004 18:27:39 -0000 1.1
+++ DeploymentContext.java 20 Feb 2004 16:18:14 -0000 1.2
@@ -72,6 +72,7 @@
import java.util.Set;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -86,7 +87,7 @@
* @version $Revision$ $Date$
*/
public class DeploymentContext {
- private final ObjectName configName;
+ private final URI configID;
private final Kernel kernel;
private final GBeanMBean config;
private final Map gbeans = new HashMap();
@@ -99,10 +100,10 @@
private final ClassLoader parentCL;
public DeploymentContext(JarOutputStream jos, URI id, URI parentID,
Kernel kernel) throws IOException,MalformedObjectNameException,
DeploymentException {
+ this.configID = id;
this.jos = jos;
this.kernel = kernel;
- configName = Kernel.getConfigObjectName(id);
config = new GBeanMBean(Configuration.GBEAN_INFO);
try {
@@ -144,6 +145,10 @@
}
+ public URI getConfigID() {
+ return configID;
+ }
+
public void addGBean(ObjectName name, GBeanMBean gbean) {
gbeans.put(name, gbean);
}
@@ -161,6 +166,14 @@
}
classPath.add(path);
includes.put(path, url);
+ }
+
+ public void addArchive(URI path, ZipInputStream archive) throws
IOException {
+ ZipEntry src;
+ while ((src = archive.getNextEntry()) != null) {
+ URI target = path.resolve(src.getName());
+ addFile(target, archive);
+ }
}
public ClassLoader getClassLoader(Repository repository) throws
DeploymentException {