1 23 24 29 30 package com.sun.enterprise.deployment.backend; 31 32 import com.sun.enterprise.util.i18n.StringManager; 33 34 39 public class DeployerFactory 40 { 41 private static StringManager localStrings = 42 StringManager.getManager( DeployerFactory.class ); 43 44 private DeployerFactory() 45 { 46 } 47 48 50 public static Deployer getDeployer(DeploymentRequest request) throws IASDeploymentException 51 { 52 assert request != null; 53 request.verify(); 54 55 if(request.isApplication()) 56 return getAppDeployer(request); 57 else if(request.isEjbModule()) 58 return new EjbModuleDeployer(request); 59 else if(request.isWebModule()) 60 return new WebModuleDeployer(request); 61 else if(request.isConnectorModule()) 62 return new ConnectorModuleDeployer(request); 63 else if (request.isAppClientModule()) 64 { 65 if(request.isDirectory()) 66 { 67 String msg = localStrings.getStringWithDefault 68 ( 69 "enterprise.deployment.backend.DirDeployOfAppClient", 70 "App Client Directory-Deployment not supported" 71 ); 72 throw new IASDeploymentException(msg); 73 } 74 else 75 return new AppClientModuleDeployer(request); 76 } 77 else { 78 String msg = localStrings.getString( 79 "enterprise.deployment.backend.deployment_not_supported" ); 80 throw new IASDeploymentException( msg ); 81 } 82 } 83 84 86 public static Deployer getAppDeployer(DeploymentRequest request) throws IASDeploymentException 87 { 88 if(request.isDeploy()) 89 { 90 return new AppDeployer(request); 91 } 92 else if(request.isReDeploy()) 93 { 94 return new AppReDeployer(request); 95 } 96 else if(request.isUnDeploy()) 97 { 98 return new AppUnDeployer(request); 99 } 100 else { 101 String msg = localStrings.getString( 102 "enterprise.deployment.backend.unknown_deployment_request_type" ); 103 throw new IASDeploymentException( msg ); 104 } 105 } 106 } 107 | Popular Tags |