1 17 package org.apache.geronimo.j2ee.deployment; 18 19 import java.io.IOException ; 20 import java.net.URI ; 21 import java.net.URISyntaxException ; 22 import java.util.Collection ; 23 import java.util.Iterator ; 24 import java.util.jar.JarFile ; 25 26 import org.apache.geronimo.deployment.DeploymentContext; 27 import org.apache.geronimo.gbean.AbstractName; 28 import org.apache.geronimo.kernel.config.ConfigurationModuleType; 29 import org.apache.geronimo.kernel.repository.Environment; 30 import org.apache.xmlbeans.XmlObject; 31 32 35 public class AppClientModule extends Module { 36 private final Environment clientEnvironment; 37 private JarFile earFile; 38 private final AbstractName appClientName; 39 private final Collection resourceModules; 40 41 42 public AppClientModule(boolean standAlone, AbstractName moduleName, AbstractName appClientName, Environment serverEnvironment, Environment clientEnvironment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, Collection resourceModules) { 43 super(standAlone, moduleName, serverEnvironment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null); 44 this.clientEnvironment = clientEnvironment; 45 this.appClientName = appClientName; 46 this.resourceModules = resourceModules; 47 } 48 49 public ConfigurationModuleType getType() { 50 return ConfigurationModuleType.CAR; 51 } 52 53 public Environment getClientEnvironment() { 54 return clientEnvironment; 55 } 56 57 public JarFile getEarFile() { 58 return earFile; 59 } 60 61 public void setEarFile(JarFile earFile) { 62 this.earFile = earFile; 63 } 64 65 public AbstractName getAppClientName() { 66 return appClientName; 67 } 68 69 public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException , URISyntaxException { 70 context.addClass(location, fqcn, bytes); 71 } 72 73 public Collection getResourceModules() { 74 return resourceModules; 75 } 76 77 public void close() { 78 if (resourceModules != null) { 79 for (Iterator iterator = resourceModules.iterator(); iterator.hasNext();) { 80 ConnectorModule connectorModule = (ConnectorModule) iterator.next(); 81 connectorModule.close(); 82 } 83 } 84 super.close(); 85 } 86 87 } 88 89 90 | Popular Tags |