1 23 24 package com.sun.enterprise.deployment.backend; 25 26 import java.util.logging.Level ; 27 import java.util.Iterator ; 28 import java.util.List ; 29 import java.util.ArrayList ; 30 import java.io.IOException ; 31 import com.sun.enterprise.deployment.Application; 32 import com.sun.enterprise.deployment.RootDeploymentDescriptor; 33 import com.sun.enterprise.deployment.ApplicationClientDescriptor; 34 import com.sun.enterprise.util.zip.ZipFileException; 35 import com.sun.enterprise.util.zip.ZipItem; 36 import com.sun.enterprise.util.io.FileUtils; 37 import com.sun.enterprise.instance.InstanceEnvironment; 38 import com.sun.enterprise.instance.ModuleEnvironment; 39 import com.sun.enterprise.instance.BaseManager; 40 import com.sun.enterprise.config.ConfigException; 41 import com.sun.enterprise.instance.AppclientModulesManager; 42 import com.sun.enterprise.util.StringUtils; 43 import com.sun.enterprise.util.i18n.StringManager; 44 import com.sun.enterprise.deployment.archivist.*; 45 import com.sun.enterprise.deployment.deploy.shared.AbstractArchive; 46 import com.sun.enterprise.loader.EJBClassPathUtils; 47 import com.sun.enterprise.deployment.phasing.DeploymentServiceUtils; 48 49 public class AppClientModuleDeployer extends ModuleDeployer 50 { 51 AppClientModuleDeployer(DeploymentRequest r) throws IASDeploymentException 52 { 53 super(r); 54 } 55 56 58 protected BaseManager createConfigManager(InstanceEnvironment ienv, ModuleEnvironment menv) 59 throws IASDeploymentException, ConfigException 60 { 61 return new AppclientModulesManager(ienv); 62 } 63 64 66 protected void preDeploy() throws IASDeploymentException 67 { 68 assert moduleDir != null; 69 assert StringUtils.ok(moduleName); 70 71 try 72 { 73 if(isRegistered()) { 74 String msg = localStrings.getString( 75 "enterprise.deployment.backend.deploy_error_module_exists"); 76 throw new IASDeploymentException( msg ); 77 } 78 79 liquidateModuleDirAndStubsDirIfTheyHappenToExist(); 83 84 if(request.isArchive()) { 85 J2EEModuleExploder.explodeJar(request.getFileSource().getFile(), moduleDir); 86 } 87 88 xmlDir.mkdirs(); 89 jwsDir.mkdirs(); 90 } 91 catch(Exception e) 92 { 93 throw new IASDeploymentException(e.toString(), e); 94 } 95 } 96 97 protected boolean needsStubs() 98 { 99 return true; 101 } 102 103 105 protected void preRedeploy() throws IASDeploymentException, ConfigException 106 { 107 setOldDirs(); 108 109 if(request.isArchive()) 110 { 111 try 112 { 113 J2EEModuleExploder.explodeJar(request.getFileSource().getFile(), moduleDir); 114 115 } 116 catch(IOException e) 117 { 118 throw new IASDeploymentException(e.toString(), e); 119 } 120 } 121 122 xmlDir.mkdir(); 123 jwsDir.mkdirs(); 124 } 125 126 128 protected void deploy() throws IASDeploymentException, ConfigException 129 { 130 loadDescriptors(); 131 runVerifier(); 132 checkAppclientsMainClasses(); 133 xmlDir.mkdirs(); 134 request.getDescriptor().setGeneratedXMLDirectory(xmlDir.getAbsolutePath()); 136 ZipItem[] clientStubs = runEJBC(); 137 createClientJar(clientStubs); 138 } 139 140 141 143 144 145 private static StringManager localStrings = 146 StringManager.getManager( AppClientModuleDeployer.class ); 147 } 148 149 | Popular Tags |