Lines 48-53
Link Here
|
48 |
import java.io.IOException; |
48 |
import java.io.IOException; |
49 |
import java.io.InputStream; |
49 |
import java.io.InputStream; |
50 |
import java.util.ArrayList; |
50 |
import java.util.ArrayList; |
|
|
51 |
import java.util.Collections; |
51 |
import java.util.List; |
52 |
import java.util.List; |
52 |
import java.util.logging.Level; |
53 |
import java.util.logging.Level; |
53 |
import java.util.logging.Logger; |
54 |
import java.util.logging.Logger; |
Lines 56-62
Link Here
|
56 |
import javax.enterprise.deploy.shared.DConfigBeanVersionType; |
57 |
import javax.enterprise.deploy.shared.DConfigBeanVersionType; |
57 |
import javax.enterprise.deploy.shared.ModuleType; |
58 |
import javax.enterprise.deploy.shared.ModuleType; |
58 |
import javax.enterprise.deploy.spi.DeploymentConfiguration; |
59 |
import javax.enterprise.deploy.spi.DeploymentConfiguration; |
59 |
import javax.enterprise.deploy.spi.DeploymentManager; |
|
|
60 |
import javax.enterprise.deploy.spi.Target; |
60 |
import javax.enterprise.deploy.spi.Target; |
61 |
import javax.enterprise.deploy.spi.TargetModuleID; |
61 |
import javax.enterprise.deploy.spi.TargetModuleID; |
62 |
import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException; |
62 |
import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException; |
Lines 76-83
Link Here
|
76 |
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; |
76 |
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; |
77 |
import org.netbeans.modules.glassfish.spi.AppDesc; |
77 |
import org.netbeans.modules.glassfish.spi.AppDesc; |
78 |
import org.netbeans.modules.glassfish.spi.GlassfishModule; |
78 |
import org.netbeans.modules.glassfish.spi.GlassfishModule; |
|
|
79 |
import org.netbeans.modules.glassfish.spi.GlassfishModule2; |
79 |
import org.netbeans.modules.glassfish.spi.ServerUtilities; |
80 |
import org.netbeans.modules.glassfish.spi.ServerUtilities; |
80 |
import org.netbeans.modules.glassfish.spi.Utils; |
81 |
import org.netbeans.modules.glassfish.spi.Utils; |
|
|
82 |
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule; |
83 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.DeploymentManager2; |
81 |
import org.openide.util.NbBundle; |
84 |
import org.openide.util.NbBundle; |
82 |
import org.xml.sax.SAXException; |
85 |
import org.xml.sax.SAXException; |
83 |
|
86 |
|
Lines 86-92
Link Here
|
86 |
* @author Ludovic Champenois |
89 |
* @author Ludovic Champenois |
87 |
* @author Peter Williams |
90 |
* @author Peter Williams |
88 |
*/ |
91 |
*/ |
89 |
public class Hk2DeploymentManager implements DeploymentManager { |
92 |
public class Hk2DeploymentManager implements DeploymentManager2 { |
90 |
|
93 |
|
91 |
private volatile ServerInstance serverInstance; |
94 |
private volatile ServerInstance serverInstance; |
92 |
private volatile InstanceProperties instanceProperties; |
95 |
private volatile InstanceProperties instanceProperties; |
Lines 118-123
Link Here
|
118 |
@Override |
121 |
@Override |
119 |
public ProgressObject distribute(Target[] targetList, final File moduleArchive, File deploymentPlan) |
122 |
public ProgressObject distribute(Target[] targetList, final File moduleArchive, File deploymentPlan) |
120 |
throws IllegalStateException { |
123 |
throws IllegalStateException { |
|
|
124 |
return distribute(targetList, moduleArchive, deploymentPlan, null); |
125 |
} |
126 |
|
127 |
@Override |
128 |
public ProgressObject distribute(Target[] targetList, final File moduleArchive, File deploymentPlan, J2eeModule module) |
129 |
throws IllegalStateException { |
121 |
String t = moduleArchive.getName(); |
130 |
String t = moduleArchive.getName(); |
122 |
final String moduleName = org.netbeans.modules.glassfish.spi.Utils.sanitizeName(t.substring(0, t.length() - 4)); |
131 |
final String moduleName = org.netbeans.modules.glassfish.spi.Utils.sanitizeName(t.substring(0, t.length() - 4)); |
123 |
// |
132 |
// |
Lines 129-134
Link Here
|
129 |
MonitorProgressObject restartProgress = new MonitorProgressObject(this, moduleId); |
138 |
MonitorProgressObject restartProgress = new MonitorProgressObject(this, moduleId); |
130 |
|
139 |
|
131 |
final GlassfishModule commonSupport = this.getCommonServerSupport(); |
140 |
final GlassfishModule commonSupport = this.getCommonServerSupport(); |
|
|
141 |
final GlassfishModule2 commonSupport2 = (commonSupport instanceof GlassfishModule2 ? |
142 |
(GlassfishModule2)commonSupport : null); |
132 |
boolean restart = false; |
143 |
boolean restart = false; |
133 |
try { |
144 |
try { |
134 |
restart = HttpMonitorHelper.synchronizeMonitor( commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR), |
145 |
restart = HttpMonitorHelper.synchronizeMonitor( commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR), |
Lines 155-161
Link Here
|
155 |
commonSupport.restartServer(restartProgress); |
166 |
commonSupport.restartServer(restartProgress); |
156 |
return updateCRProgress; |
167 |
return updateCRProgress; |
157 |
} else { |
168 |
} else { |
|
|
169 |
if (commonSupport2 != null && module != null) { |
170 |
commonSupport2.deploy(deployProgress, moduleArchive, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries()); |
171 |
} else { |
158 |
commonSupport.deploy(deployProgress, moduleArchive, moduleName); |
172 |
commonSupport.deploy(deployProgress, moduleArchive, moduleName); |
|
|
173 |
} |
159 |
return updateCRProgress; |
174 |
return updateCRProgress; |
160 |
} |
175 |
} |
161 |
} |
176 |
} |
Lines 172-180
Link Here
|
172 |
@Override |
187 |
@Override |
173 |
public ProgressObject redeploy(TargetModuleID [] moduleIDList, final File moduleArchive, File deploymentPlan) |
188 |
public ProgressObject redeploy(TargetModuleID [] moduleIDList, final File moduleArchive, File deploymentPlan) |
174 |
throws UnsupportedOperationException, IllegalStateException { |
189 |
throws UnsupportedOperationException, IllegalStateException { |
|
|
190 |
return redeploy(moduleIDList, moduleArchive, deploymentPlan, null); |
191 |
} |
192 |
|
193 |
@Override |
194 |
public ProgressObject redeploy(TargetModuleID [] moduleIDList, final File moduleArchive, File deploymentPlan, J2eeModule module) |
195 |
throws UnsupportedOperationException, IllegalStateException { |
175 |
final Hk2TargetModuleID moduleId = (Hk2TargetModuleID) moduleIDList[0]; |
196 |
final Hk2TargetModuleID moduleId = (Hk2TargetModuleID) moduleIDList[0]; |
176 |
final String moduleName = moduleId.getModuleID(); |
197 |
final String moduleName = moduleId.getModuleID(); |
177 |
|
|
|
178 |
final MonitorProgressObject progressObject = new MonitorProgressObject(this, |
198 |
final MonitorProgressObject progressObject = new MonitorProgressObject(this, |
179 |
moduleId, CommandType.REDEPLOY); |
199 |
moduleId, CommandType.REDEPLOY); |
180 |
MonitorProgressObject restartObject = new MonitorProgressObject(this,moduleId, |
200 |
MonitorProgressObject restartObject = new MonitorProgressObject(this,moduleId, |
Lines 182-187
Link Here
|
182 |
final MonitorProgressObject updateCRObject = new MonitorProgressObject(this, |
202 |
final MonitorProgressObject updateCRObject = new MonitorProgressObject(this, |
183 |
moduleId, CommandType.REDEPLOY); |
203 |
moduleId, CommandType.REDEPLOY); |
184 |
final GlassfishModule commonSupport = this.getCommonServerSupport(); |
204 |
final GlassfishModule commonSupport = this.getCommonServerSupport(); |
|
|
205 |
final GlassfishModule2 commonSupport2 = (commonSupport instanceof GlassfishModule2 ? |
206 |
(GlassfishModule2)commonSupport : null); |
185 |
// FIXME -- broken for remote deploy of web apps |
207 |
// FIXME -- broken for remote deploy of web apps |
186 |
progressObject.addProgressListener(new UpdateContextRoot(updateCRObject,moduleId,getServerInstance(), true)); |
208 |
progressObject.addProgressListener(new UpdateContextRoot(updateCRObject,moduleId,getServerInstance(), true)); |
187 |
boolean restart = false; |
209 |
boolean restart = false; |
Lines 214-220
Link Here
|
214 |
commonSupport.restartServer(restartObject); |
236 |
commonSupport.restartServer(restartObject); |
215 |
return updateCRObject; |
237 |
return updateCRObject; |
216 |
} else { |
238 |
} else { |
|
|
239 |
if (commonSupport2 != null && module != null) { |
240 |
commonSupport2.deploy(progressObject, moduleArchive, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries()); |
241 |
} else { |
217 |
commonSupport.deploy(progressObject, moduleArchive, moduleName); |
242 |
commonSupport.deploy(progressObject, moduleArchive, moduleName); |
|
|
243 |
} |
218 |
return updateCRObject; |
244 |
return updateCRObject; |
219 |
} |
245 |
} |
220 |
} |
246 |
} |