Lines 46-51
Link Here
|
46 |
|
46 |
|
47 |
import java.io.File; |
47 |
import java.io.File; |
48 |
import java.io.IOException; |
48 |
import java.io.IOException; |
|
|
49 |
import java.util.Collections; |
49 |
import java.util.logging.Level; |
50 |
import java.util.logging.Level; |
50 |
import java.util.logging.Logger; |
51 |
import java.util.logging.Logger; |
51 |
import javax.enterprise.deploy.shared.CommandType; |
52 |
import javax.enterprise.deploy.shared.CommandType; |
Lines 65-70
Link Here
|
65 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment; |
66 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment; |
66 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration; |
67 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration; |
67 |
import org.netbeans.modules.glassfish.spi.GlassfishModule; |
68 |
import org.netbeans.modules.glassfish.spi.GlassfishModule; |
|
|
69 |
import org.netbeans.modules.glassfish.spi.GlassfishModule2; |
68 |
import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor; |
70 |
import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor; |
69 |
import org.openide.filesystems.FileObject; |
71 |
import org.openide.filesystems.FileObject; |
70 |
import org.openide.filesystems.FileUtil; |
72 |
import org.openide.filesystems.FileUtil; |
Lines 98-104
Link Here
|
98 |
* @param file |
100 |
* @param file |
99 |
* @return |
101 |
* @return |
100 |
*/ |
102 |
*/ |
101 |
public ProgressObject initialDeploy(Target target, J2eeModule module, ModuleConfiguration configuration, final File dir) { |
103 |
public ProgressObject initialDeploy(Target target, final J2eeModule module, ModuleConfiguration configuration, final File dir) { |
102 |
final String moduleName = org.netbeans.modules.glassfish.spi.Utils.sanitizeName(Utils.computeModuleID(module, dir, Integer.toString(hashCode()))); |
104 |
final String moduleName = org.netbeans.modules.glassfish.spi.Utils.sanitizeName(Utils.computeModuleID(module, dir, Integer.toString(hashCode()))); |
103 |
String contextRoot = null; |
105 |
String contextRoot = null; |
104 |
// XXX fix cast -- need error instance for ProgressObject to return errors |
106 |
// XXX fix cast -- need error instance for ProgressObject to return errors |
Lines 110-115
Link Here
|
110 |
MonitorProgressObject restartProgress = new MonitorProgressObject(dm, moduleId); |
112 |
MonitorProgressObject restartProgress = new MonitorProgressObject(dm, moduleId); |
111 |
|
113 |
|
112 |
final GlassfishModule commonSupport = dm.getCommonServerSupport(); |
114 |
final GlassfishModule commonSupport = dm.getCommonServerSupport(); |
|
|
115 |
final GlassfishModule2 commonSupport2 = (commonSupport instanceof GlassfishModule2 ? |
116 |
(GlassfishModule2)commonSupport : null); |
113 |
boolean restart = false; |
117 |
boolean restart = false; |
114 |
try { |
118 |
try { |
115 |
restart = HttpMonitorHelper.synchronizeMonitor(commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR), |
119 |
restart = HttpMonitorHelper.synchronizeMonitor(commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR), |
Lines 126-132
Link Here
|
126 |
restartProgress.addProgressListener(new ProgressListener() { |
130 |
restartProgress.addProgressListener(new ProgressListener() { |
127 |
public void handleProgressEvent(ProgressEvent event) { |
131 |
public void handleProgressEvent(ProgressEvent event) { |
128 |
if (event.getDeploymentStatus().isCompleted()) { |
132 |
if (event.getDeploymentStatus().isCompleted()) { |
|
|
133 |
if (commonSupport2 != null) { |
134 |
commonSupport2.deploy(deployProgress, dir, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries()); |
135 |
} else { |
129 |
commonSupport.deploy(deployProgress, dir, moduleName); |
136 |
commonSupport.deploy(deployProgress, dir, moduleName); |
|
|
137 |
} |
130 |
} else { |
138 |
} else { |
131 |
deployProgress.fireHandleProgressEvent(event.getDeploymentStatus()); |
139 |
deployProgress.fireHandleProgressEvent(event.getDeploymentStatus()); |
132 |
} |
140 |
} |
Lines 135-141
Link Here
|
135 |
commonSupport.restartServer(restartProgress); |
143 |
commonSupport.restartServer(restartProgress); |
136 |
return updateCRProgress; |
144 |
return updateCRProgress; |
137 |
} else { |
145 |
} else { |
|
|
146 |
if (commonSupport2 != null) { |
147 |
commonSupport2.deploy(deployProgress, dir, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries()); |
148 |
} else { |
138 |
commonSupport.deploy(deployProgress, dir, moduleName); |
149 |
commonSupport.deploy(deployProgress, dir, moduleName); |
|
|
150 |
} |
139 |
return updateCRProgress; |
151 |
return updateCRProgress; |
140 |
} |
152 |
} |
141 |
} |
153 |
} |