1 19 20 package org.netbeans.tests.j2eeserver.plugin; 21 22 import javax.enterprise.deploy.model.*; 23 import javax.enterprise.deploy.spi.*; 24 import javax.enterprise.deploy.shared.*; 25 import javax.enterprise.deploy.spi.status.*; 26 import org.netbeans.modules.j2ee.deployment.plugins.api.*; 27 import org.netbeans.modules.j2ee.deployment.plugins.api.*; 28 import org.netbeans.tests.j2eeserver.plugin.jsr88.*; 29 30 import java.io.*; 31 import java.util.*; 32 33 37 public class IncrementalDeploySupport extends IncrementalDeployment { 38 DepManager dm; 39 File applicationsDir; 40 HashMap moduleDirectories = new HashMap(); 41 42 43 public IncrementalDeploySupport(DeploymentManager manager) { 44 this.dm = (DepManager) dm; 45 } 46 47 public void setDeploymentManager(DeploymentManager manager) { 48 if (manager instanceof DepManager) 49 dm = (DepManager) manager; 50 else 51 throw new IllegalArgumentException ("setDeploymentManager: Invalid manager type"); 52 } 53 54 File getApplicationsDir() { 55 if (applicationsDir != null) 56 return applicationsDir; 57 58 File userdir = new File(System.getProperty("netbeans.user")); 59 applicationsDir = new File(userdir, "testplugin/applications"); 60 if (! applicationsDir.exists()) 61 applicationsDir.mkdirs(); 62 return applicationsDir; 63 } 64 65 static Map planFileNames = new HashMap(); 66 static { 67 planFileNames.put(ModuleType.WAR, new String [] {"tpi-web.xml"}); 68 planFileNames.put(ModuleType.EJB, new String [] {"tpi-ejb-jar.xml"}); 69 planFileNames.put(ModuleType.EAR, new String [] {"tpi-application.xml"}); 70 } 71 72 public File getDirectoryForModule (TargetModuleID module) { 73 File appDir = new File(getApplicationsDir(), getModuleRelativePath((TestTargetMoid)module)); 74 if (! appDir.exists()) 75 appDir.mkdirs(); 76 System.out.println("getDirectoryForModule("+module+") returned: "+appDir); 77 return appDir; 78 } 79 80 String getModuleRelativePath(TestTargetMoid module) { 81 File path; 82 if (module.getParent() != null) 83 path = new File(module.getParent().getModuleID(), module.getModuleID()); 84 else 85 path = new File(module.getModuleID()); 86 return path.getPath(); 87 } 88 89 public String getModuleUrl(TargetModuleID module) { 90 return ((TestTargetMoid)module).getModuleUrl(); 91 } 92 93 94 public ProgressObject incrementalDeploy (TargetModuleID module, AppChangeDescriptor changes) { 95 return null; } 97 98 public boolean canFileDeploy (Target target, DeployableObject deployable) { 99 return true; 100 } 101 102 public File getDirectoryForNewApplication (Target target, DeployableObject app, DeploymentConfiguration configuration) { 103 return null; 104 } 105 106 public File getDirectoryForNewModule (File appDir, String uri, DeployableObject module, DeploymentConfiguration configuration) { 107 return null; 108 } 109 110 public ProgressObject initialDeploy (Target target, DeployableObject app, DeploymentConfiguration configuration, File dir) { 111 return null; 112 } 113 114 } 115 | Popular Tags |