This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 186331
Collapse All | Expand All

(-)a/glassfish.common/manifest.mf (-1 / +1 lines)
Lines 3-8 Link Here
3
OpenIDE-Module-Install: org/netbeans/modules/glassfish/common/Installer.class
3
OpenIDE-Module-Install: org/netbeans/modules/glassfish/common/Installer.class
4
OpenIDE-Module-Layer: org/netbeans/modules/glassfish/common/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/glassfish/common/layer.xml
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/common/Bundle.properties
5
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/common/Bundle.properties
6
OpenIDE-Module-Specification-Version: 1.8
6
OpenIDE-Module-Specification-Version: 1.9
7
OpenIDE-Module-Provides: org.netbeans.modules.glassfish.common
7
OpenIDE-Module-Provides: org.netbeans.modules.glassfish.common
8
8
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/common/CommandRunner.java (-5 / +6 lines)
Lines 390-405 Link Here
390
    }
390
    }
391
    
391
    
392
    public Future<OperationState> deploy(File dir, String moduleName, String contextRoot)  {
392
    public Future<OperationState> deploy(File dir, String moduleName, String contextRoot)  {
393
        return deploy(dir, moduleName, contextRoot, null);
393
        return deploy(dir, moduleName, contextRoot, null, new File[0]);
394
    }
394
    }
395
    
395
    
396
    Future<OperationState> deploy(File dir, String moduleName, String contextRoot, Map<String,String> properties) {
396
    public Future<OperationState> deploy(File dir, String moduleName, String contextRoot, Map<String,String> properties, File[] libraries) {
397
        return execute(new Commands.DeployCommand(dir, moduleName,
397
        return execute(new Commands.DeployCommand(dir, moduleName,
398
                contextRoot, computePreserveSessions(ip), properties));
398
                contextRoot, computePreserveSessions(ip), properties, libraries));
399
    }
399
    }
400
        public Future<OperationState> redeploy(String moduleName, String contextRoot)  {
400
    
401
    public Future<OperationState> redeploy(String moduleName, String contextRoot, File[] libraries)  {
401
        return execute(new Commands.RedeployCommand(moduleName, contextRoot, 
402
        return execute(new Commands.RedeployCommand(moduleName, contextRoot, 
402
                computePreserveSessions(ip)));
403
                computePreserveSessions(ip), libraries));
403
    }
404
    }
404
405
405
    private static Boolean computePreserveSessions(Map<String,String> ip) {
406
    private static Boolean computePreserveSessions(Map<String,String> ip) {
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/common/Commands.java (-2 / +20 lines)
Lines 287-292 Link Here
287
        }
287
        }
288
    };
288
    };
289
289
290
    private static void appendLibraries(StringBuilder cmd, File[] libraries) {
291
        cmd.append(ServerCommand.PARAM_SEPARATOR).append("libraries="); // NOI18N
292
        boolean firstOne = true;
293
        for (File f : libraries) {
294
            if (!firstOne) {
295
                cmd.append(",");
296
            }
297
            cmd.append(f.getPath()); // NOI18N
298
            firstOne = false;
299
        }
300
    }
301
290
    /**
302
    /**
291
     * Command to deploy a directory
303
     * Command to deploy a directory
292
     */
304
     */
Lines 295-301 Link Here
295
        private final boolean isDirDeploy;
307
        private final boolean isDirDeploy;
296
        private final File path;
308
        private final File path;
297
309
298
        public DeployCommand(final File path, final String name, final String contextRoot, final Boolean preserveSessions, final Map<String,String> properties) {
310
        public DeployCommand(final File path, final String name, final String contextRoot, final Boolean preserveSessions, final Map<String,String> properties, File[] libraries) {
299
            super("deploy"); // NOI18N
311
            super("deploy"); // NOI18N
300
312
301
            this.isDirDeploy = path.isDirectory();
313
            this.isDirDeploy = path.isDirectory();
Lines 312-317 Link Here
312
                cmd.append(PARAM_SEPARATOR).append("contextroot="); // NOI18N
324
                cmd.append(PARAM_SEPARATOR).append("contextroot="); // NOI18N
313
                cmd.append(contextRoot);
325
                cmd.append(contextRoot);
314
            }
326
            }
327
            if (libraries.length > 0) {
328
                appendLibraries(cmd, libraries);
329
            }
315
            cmd.append(PARAM_SEPARATOR).append("force=true"); // NOI18N
330
            cmd.append(PARAM_SEPARATOR).append("force=true"); // NOI18N
316
            addProperties(cmd,properties);
331
            addProperties(cmd,properties);
317
            query = cmd.toString();
332
            query = cmd.toString();
Lines 377-383 Link Here
377
     */
392
     */
378
    public static final class RedeployCommand extends ServerCommand {
393
    public static final class RedeployCommand extends ServerCommand {
379
394
380
        public RedeployCommand(final String name, final String contextRoot, final Boolean preserveSessions) {
395
        public RedeployCommand(final String name, final String contextRoot, final Boolean preserveSessions, File[] libraries) {
381
            super("redeploy"); // NOI18N
396
            super("redeploy"); // NOI18N
382
397
383
            StringBuilder cmd = new StringBuilder(128);
398
            StringBuilder cmd = new StringBuilder(128);
Lines 387-392 Link Here
387
                cmd.append(PARAM_SEPARATOR).append("contextroot="); // NOI18N
402
                cmd.append(PARAM_SEPARATOR).append("contextroot="); // NOI18N
388
                cmd.append(contextRoot);
403
                cmd.append(contextRoot);
389
            }
404
            }
405
            if (libraries.length > 0) {
406
                appendLibraries(cmd, libraries);
407
            }
390
            addKeepSessions(cmd, preserveSessions);
408
            addKeepSessions(cmd, preserveSessions);
391
            query = cmd.toString();
409
            query = cmd.toString();
392
        }
410
        }
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/common/CommonServerSupport.java (-3 / +14 lines)
Lines 75-80 Link Here
75
import org.netbeans.modules.glassfish.spi.ServerCommand;
75
import org.netbeans.modules.glassfish.spi.ServerCommand;
76
import org.netbeans.modules.glassfish.spi.ServerCommand.GetPropertyCommand;
76
import org.netbeans.modules.glassfish.spi.ServerCommand.GetPropertyCommand;
77
import org.netbeans.modules.glassfish.spi.CommandFactory;
77
import org.netbeans.modules.glassfish.spi.CommandFactory;
78
import org.netbeans.modules.glassfish.spi.GlassfishModule2;
78
import org.netbeans.modules.glassfish.spi.Utils;
79
import org.netbeans.modules.glassfish.spi.Utils;
79
import org.openide.DialogDisplayer;
80
import org.openide.DialogDisplayer;
80
import org.openide.NotifyDescriptor;
81
import org.openide.NotifyDescriptor;
Lines 90-96 Link Here
90
 *
91
 *
91
 * @author Peter Williams
92
 * @author Peter Williams
92
 */
93
 */
93
public class CommonServerSupport implements GlassfishModule, RefreshModulesCookie {
94
public class CommonServerSupport implements GlassfishModule2, RefreshModulesCookie {
94
95
95
    private final transient Lookup lookup;
96
    private final transient Lookup lookup;
96
    private final Map<String, String> properties =
97
    private final Map<String, String> properties =
Lines 420-428 Link Here
420
    @Override
421
    @Override
421
    public Future<OperationState> deploy(final OperationStateListener stateListener,
422
    public Future<OperationState> deploy(final OperationStateListener stateListener,
422
            final File application, final String name, final String contextRoot, Map<String,String> properties) {
423
            final File application, final String name, final String contextRoot, Map<String,String> properties) {
424
        return deploy(stateListener, application, name, contextRoot, null, new File[0]);
425
    }
426
    
427
    @Override
428
    public Future<OperationState> deploy(OperationStateListener stateListener, File application, String name, String contextRoot, Map<String, String> properties, File[] libraries) {
423
        CommandRunner mgr = new CommandRunner(isReallyRunning(), getCommandFactory(), getInstanceProperties(), stateListener);
429
        CommandRunner mgr = new CommandRunner(isReallyRunning(), getCommandFactory(), getInstanceProperties(), stateListener);
424
        
430
        
425
        return mgr.deploy(application, name, contextRoot, properties);
431
        return mgr.deploy(application, name, contextRoot, properties, libraries);
426
    }
432
    }
427
    
433
    
428
    @Override
434
    @Override
Lines 434-441 Link Here
434
    @Override
440
    @Override
435
    public Future<OperationState> redeploy(final OperationStateListener stateListener, 
441
    public Future<OperationState> redeploy(final OperationStateListener stateListener, 
436
            final String name, final String contextRoot) {
442
            final String name, final String contextRoot) {
443
        return redeploy(stateListener, name, contextRoot, new File[0]);
444
    }
445
446
    @Override
447
    public Future<OperationState> redeploy(OperationStateListener stateListener, String name, String contextRoot, File[] libraries) {
437
        CommandRunner mgr = new CommandRunner(isReallyRunning(), getCommandFactory(), getInstanceProperties(), stateListener);
448
        CommandRunner mgr = new CommandRunner(isReallyRunning(), getCommandFactory(), getInstanceProperties(), stateListener);
438
        return mgr.redeploy(name, contextRoot);
449
        return mgr.redeploy(name, contextRoot, libraries);
439
    }
450
    }
440
451
441
    @Override
452
    @Override
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/spi/GlassfishModule2.java (+73 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 * 
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 * 
38
 * Contributor(s):
39
 * 
40
 * Portions Copyrighted 2007 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.glassfish.spi;
44
45
import java.io.File;
46
import java.util.Map;
47
import java.util.concurrent.Future;
48
49
50
/**
51
 * Extended version of GlassfishModule supporting deployment of standalone
52
 * EE module with libraries they require.
53
 * 
54
 * @since org.netbeans.modules.glassfish.common/0 1.9
55
 */
56
public interface GlassfishModule2 extends GlassfishModule {
57
58
    /**
59
     * @param libraries array of jar files on which standalone EE module depends
60
     *  and which need to be part of deployment
61
     */
62
    public Future<OperationState> deploy(OperationStateListener stateListener,
63
            File application, String name, String contextRoot, Map<String,String> properties,
64
            File[] libraries);
65
66
    /**
67
     * @param libraries array of jar files on which standalone EE module depends
68
     *  and which need to be part of deployment
69
     */
70
    public Future<OperationState> redeploy(final OperationStateListener stateListener, 
71
            final String name, final String contextRoot, File[] libraries);
72
    
73
}
(-)a/glassfish.javaee/nbproject/project.xml (-2 / +2 lines)
Lines 38-44 Link Here
38
                    <compile-dependency/>
38
                    <compile-dependency/>
39
                    <run-dependency>
39
                    <run-dependency>
40
                        <release-version>0-1</release-version>
40
                        <release-version>0-1</release-version>
41
                        <specification-version>1.2</specification-version>
41
                        <specification-version>1.9</specification-version>
42
                    </run-dependency>
42
                    </run-dependency>
43
                </dependency>
43
                </dependency>
44
                <dependency>
44
                <dependency>
Lines 92-98 Link Here
92
                    <compile-dependency/>
92
                    <compile-dependency/>
93
                    <run-dependency>
93
                    <run-dependency>
94
                        <release-version>4</release-version>
94
                        <release-version>4</release-version>
95
                        <specification-version>1.65</specification-version>
95
                        <specification-version>1.69</specification-version>
96
                    </run-dependency>
96
                    </run-dependency>
97
                </dependency>
97
                </dependency>
98
                <dependency>
98
                <dependency>
(-)a/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentManager.java (-3 / +29 lines)
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
    }
(-)a/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/FastDeploy.java (-1 / +14 lines)
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
    @Override
104
    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())));
105
        final String moduleName = org.netbeans.modules.glassfish.spi.Utils.sanitizeName(Utils.computeModuleID(module, dir, Integer.toString(hashCode())));
103
        String contextRoot = null;
106
        String contextRoot = null;
104
        // XXX fix cast -- need error instance for ProgressObject to return errors
107
        // XXX fix cast -- need error instance for ProgressObject to return errors
Lines 110-115 Link Here
110
        MonitorProgressObject restartProgress = new MonitorProgressObject(dm, moduleId);
113
        MonitorProgressObject restartProgress = new MonitorProgressObject(dm, moduleId);
111
114
112
        final GlassfishModule commonSupport = dm.getCommonServerSupport();
115
        final GlassfishModule commonSupport = dm.getCommonServerSupport();
116
        final GlassfishModule2 commonSupport2 = (commonSupport instanceof GlassfishModule2 ?
117
            (GlassfishModule2)commonSupport : null);
113
        boolean restart = false;
118
        boolean restart = false;
114
        try {
119
        try {
115
            restart = HttpMonitorHelper.synchronizeMonitor(commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR),
120
            restart = HttpMonitorHelper.synchronizeMonitor(commonSupport.getInstanceProperties().get(GlassfishModule.DOMAINS_FOLDER_ATTR),
Lines 126-132 Link Here
126
            restartProgress.addProgressListener(new ProgressListener() {
131
            restartProgress.addProgressListener(new ProgressListener() {
127
                public void handleProgressEvent(ProgressEvent event) {
132
                public void handleProgressEvent(ProgressEvent event) {
128
                    if (event.getDeploymentStatus().isCompleted()) {
133
                    if (event.getDeploymentStatus().isCompleted()) {
134
                        if (commonSupport2 != null) {
135
                            commonSupport2.deploy(deployProgress, dir, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries());
136
                        } else {
129
                        commonSupport.deploy(deployProgress, dir, moduleName);
137
                        commonSupport.deploy(deployProgress, dir, moduleName);
138
                        }
130
                    } else {
139
                    } else {
131
                        deployProgress.fireHandleProgressEvent(event.getDeploymentStatus());
140
                        deployProgress.fireHandleProgressEvent(event.getDeploymentStatus());
132
                    }
141
                    }
Lines 135-141 Link Here
135
            commonSupport.restartServer(restartProgress);
144
            commonSupport.restartServer(restartProgress);
136
            return updateCRProgress;
145
            return updateCRProgress;
137
        } else {
146
        } else {
147
            if (commonSupport2 != null) {
148
                commonSupport2.deploy(deployProgress, dir, moduleName, null, Collections.<String, String>emptyMap(), module.getRequiredLibraries());
149
            } else {
138
            commonSupport.deploy(deployProgress, dir, moduleName);
150
            commonSupport.deploy(deployProgress, dir, moduleName);
151
            }
139
            return updateCRProgress;
152
            return updateCRProgress;
140
        }
153
        }
141
    }
154
    }
(-)a/j2ee.clientproject/nbproject/project.xml (-1 / +1 lines)
Lines 209-215 Link Here
209
                    <compile-dependency/>
209
                    <compile-dependency/>
210
                    <run-dependency>
210
                    <run-dependency>
211
                        <release-version>4</release-version>
211
                        <release-version>4</release-version>
212
                        <specification-version>1.63</specification-version>
212
                        <specification-version>1.69</specification-version>
213
                    </run-dependency>
213
                    </run-dependency>
214
                </dependency>
214
                </dependency>
215
                <dependency>
215
                <dependency>
(-)a/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java (-2 / +21 lines)
Lines 49-54 Link Here
49
import java.beans.PropertyChangeSupport;
49
import java.beans.PropertyChangeSupport;
50
import java.io.File;
50
import java.io.File;
51
import java.io.IOException;
51
import java.io.IOException;
52
import java.util.ArrayList;
52
import java.util.Date;
53
import java.util.Date;
53
import java.util.Enumeration;
54
import java.util.Enumeration;
54
import java.util.Iterator;
55
import java.util.Iterator;
Lines 77-90 Link Here
77
import org.netbeans.modules.j2ee.deployment.devmodules.api.ModuleChangeReporter;
78
import org.netbeans.modules.j2ee.deployment.devmodules.api.ModuleChangeReporter;
78
import org.netbeans.modules.j2ee.deployment.devmodules.api.ResourceChangeReporter;
79
import org.netbeans.modules.j2ee.deployment.devmodules.api.ResourceChangeReporter;
79
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleFactory;
80
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleFactory;
80
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation2;
81
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation3;
81
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
82
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
82
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterFactory;
83
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterFactory;
83
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterImplementation;
84
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterImplementation;
84
import org.netbeans.modules.j2ee.metadata.model.api.MetadataModel;
85
import org.netbeans.modules.j2ee.metadata.model.api.MetadataModel;
85
import org.netbeans.modules.java.api.common.project.ProjectProperties;
86
import org.netbeans.modules.java.api.common.project.ProjectProperties;
86
import org.netbeans.modules.websvc.api.client.WebServicesClientConstants;
87
import org.netbeans.modules.websvc.api.client.WebServicesClientConstants;
88
import org.netbeans.spi.java.classpath.ClassPathFactory;
87
import org.netbeans.spi.java.classpath.ClassPathProvider;
89
import org.netbeans.spi.java.classpath.ClassPathProvider;
90
import org.netbeans.spi.java.project.classpath.support.ProjectClassPathSupport;
88
import org.netbeans.spi.project.support.ant.AntProjectHelper;
91
import org.netbeans.spi.project.support.ant.AntProjectHelper;
89
import org.netbeans.spi.project.support.ant.EditableProperties;
92
import org.netbeans.spi.project.support.ant.EditableProperties;
90
import org.openide.DialogDisplayer;
93
import org.openide.DialogDisplayer;
Lines 97-103 Link Here
97
 * @author jungi
100
 * @author jungi
98
 */
101
 */
99
public final class AppClientProvider extends J2eeModuleProvider
102
public final class AppClientProvider extends J2eeModuleProvider
100
        implements J2eeModuleImplementation2, ModuleChangeReporter, EjbChangeDescriptor, PropertyChangeListener {
103
        implements J2eeModuleImplementation3, ModuleChangeReporter, EjbChangeDescriptor, PropertyChangeListener {
101
    
104
    
102
    public static final String FILE_DD = "application-client.xml";//NOI18N
105
    public static final String FILE_DD = "application-client.xml";//NOI18N
103
106
Lines 176-181 Link Here
176
        return project.getClassPathProvider();
179
        return project.getClassPathProvider();
177
    }
180
    }
178
    
181
    
182
    @Override
183
    public File[] getRequiredLibraries() {
184
        ClassPath cp = ClassPathFactory.createClassPath(
185
                    ProjectClassPathSupport.createPropertyBasedClassPathImplementation(
186
                    FileUtil.toFile(project.getProjectDirectory()), project.evaluator(), new String[]{"javac.classpath"}));
187
        List<File> files = new ArrayList<File>();
188
        for (FileObject fo : cp.getRoots()) {
189
            fo = FileUtil.getArchiveFile(fo);
190
            if (fo == null) {
191
                continue;
192
            }
193
            files.add(FileUtil.toFile(fo));
194
        }
195
        return files.toArray(new File[files.size()]);
196
    }
197
179
    public FileObject getArchive() {
198
    public FileObject getArchive() {
180
        return getFileObject(AppClientProjectProperties.DIST_JAR);
199
        return getFileObject(AppClientProjectProperties.DIST_JAR);
181
    }
200
    }
(-)a/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl (-2 / +2 lines)
Lines 987-993 Link Here
987
            </target>
987
            </target>
988
            
988
            
989
            <target name="library-inclusion-in-archive" depends="compile">
989
            <target name="library-inclusion-in-archive" depends="compile">
990
                <xsl:if test="count(//carproject:included-library) &gt; 0">
990
<!--                <xsl:if test="count(//carproject:included-library) &gt; 0">
991
                    <mkdir dir="${{build.classes.dir}}/META-INF/lib"/>
991
                    <mkdir dir="${{build.classes.dir}}/META-INF/lib"/>
992
                </xsl:if>
992
                </xsl:if>
993
                <xsl:for-each select="//carproject:included-library">
993
                <xsl:for-each select="//carproject:included-library">
Lines 997-1003 Link Here
997
                    <copyfiles todir="${{build.classes.dir}}/META-INF/lib">
997
                    <copyfiles todir="${{build.classes.dir}}/META-INF/lib">
998
                       <xsl:attribute name="files"><xsl:value-of select="concat('${',$included.prop.name,'}')"/></xsl:attribute>
998
                       <xsl:attribute name="files"><xsl:value-of select="concat('${',$included.prop.name,'}')"/></xsl:attribute>
999
                    </copyfiles>
999
                    </copyfiles>
1000
                </xsl:for-each>
1000
                </xsl:for-each> -->
1001
            </target>
1001
            </target>
1002
            
1002
            
1003
            <target name="library-inclusion-in-manifest" depends="compile">
1003
            <target name="library-inclusion-in-manifest" depends="compile">
(-)a/j2ee.ejbjarproject/nbproject/project.xml (-1 / +1 lines)
Lines 235-241 Link Here
235
                    <compile-dependency/>
235
                    <compile-dependency/>
236
                    <run-dependency>
236
                    <run-dependency>
237
                        <release-version>4</release-version>
237
                        <release-version>4</release-version>
238
                        <specification-version>1.63</specification-version>
238
                        <specification-version>1.69</specification-version>
239
                    </run-dependency>
239
                    </run-dependency>
240
                </dependency>
240
                </dependency>
241
                <dependency>
241
                <dependency>
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProvider.java (-2 / +22 lines)
Lines 42-47 Link Here
42
import java.beans.PropertyChangeListener;
42
import java.beans.PropertyChangeListener;
43
import java.beans.PropertyChangeSupport;
43
import java.beans.PropertyChangeSupport;
44
import java.io.File;
44
import java.io.File;
45
import java.util.ArrayList;
45
import java.util.Date;
46
import java.util.Date;
46
import java.util.Iterator;
47
import java.util.Iterator;
47
import java.util.LinkedList;
48
import java.util.LinkedList;
Lines 79-89 Link Here
79
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
80
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
80
import org.netbeans.modules.j2ee.deployment.devmodules.api.ModuleChangeReporter;
81
import org.netbeans.modules.j2ee.deployment.devmodules.api.ModuleChangeReporter;
81
import org.netbeans.modules.j2ee.deployment.devmodules.api.ResourceChangeReporter;
82
import org.netbeans.modules.j2ee.deployment.devmodules.api.ResourceChangeReporter;
82
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation2;
83
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation3;
83
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterFactory;
84
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterFactory;
84
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterImplementation;
85
import org.netbeans.modules.j2ee.deployment.devmodules.spi.ResourceChangeReporterImplementation;
85
import org.netbeans.modules.java.api.common.project.ProjectProperties;
86
import org.netbeans.modules.java.api.common.project.ProjectProperties;
86
import org.netbeans.modules.websvc.spi.webservices.WebServicesConstants;
87
import org.netbeans.modules.websvc.spi.webservices.WebServicesConstants;
88
import org.netbeans.spi.java.classpath.ClassPathFactory;
89
import org.netbeans.spi.java.project.classpath.support.ProjectClassPathSupport;
87
90
88
91
89
/** A ejb module implementation on top of project.
92
/** A ejb module implementation on top of project.
Lines 91-97 Link Here
91
 * @author  Pavel Buzek
94
 * @author  Pavel Buzek
92
 */
95
 */
93
public final class EjbJarProvider extends J2eeModuleProvider
96
public final class EjbJarProvider extends J2eeModuleProvider
94
        implements J2eeModuleImplementation2, ModuleChangeReporter, EjbChangeDescriptor, PropertyChangeListener {
97
        implements J2eeModuleImplementation3, ModuleChangeReporter, EjbChangeDescriptor, PropertyChangeListener {
95
    
98
    
96
    public static final String FILE_DD = "ejb-jar.xml";//NOI18N
99
    public static final String FILE_DD = "ejb-jar.xml";//NOI18N
97
100
Lines 187-192 Link Here
187
        return project.getClassPathProvider();
190
        return project.getClassPathProvider();
188
    }
191
    }
189
    
192
    
193
    @Override
190
    public FileObject getArchive() {
194
    public FileObject getArchive() {
191
        return getFileObject(EjbJarProjectProperties.DIST_JAR);
195
        return getFileObject(EjbJarProjectProperties.DIST_JAR);
192
    }
196
    }
Lines 477-482 Link Here
477
        }
481
        }
478
    }
482
    }
479
483
484
    @Override
485
    public File[] getRequiredLibraries() {
486
        ClassPath cp = ClassPathFactory.createClassPath(
487
                    ProjectClassPathSupport.createPropertyBasedClassPathImplementation(
488
                    FileUtil.toFile(project.getProjectDirectory()), project.evaluator(), new String[]{"javac.classpath"}));
489
        List<File> files = new ArrayList<File>();
490
        for (FileObject fo : cp.getRoots()) {
491
            fo = FileUtil.getArchiveFile(fo);
492
            if (fo == null) {
493
                continue;
494
            }
495
            files.add(FileUtil.toFile(fo));
496
        }
497
        return files.toArray(new File[files.size()]);
498
    }
499
480
    private class EjbJarResourceChangeReporter implements ResourceChangeReporterImplementation {
500
    private class EjbJarResourceChangeReporter implements ResourceChangeReporterImplementation {
481
501
482
        public boolean isServerResourceChanged(long lastDeploy) {
502
        public boolean isServerResourceChanged(long lastDeploy) {
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl (-2 / +2 lines)
Lines 990-1003 Link Here
990
            </target>
990
            </target>
991
            
991
            
992
            <target name="library-inclusion-in-archive" depends="compile">
992
            <target name="library-inclusion-in-archive" depends="compile">
993
                <xsl:for-each select="//ejbjarproject3:included-library">
993
<!--                <xsl:for-each select="//ejbjarproject3:included-library">
994
                    <xsl:variable name="included.prop.name">
994
                    <xsl:variable name="included.prop.name">
995
                        <xsl:value-of select="."/>
995
                        <xsl:value-of select="."/>
996
                    </xsl:variable>
996
                    </xsl:variable>
997
                    <copyfiles todir="${{build.classes.dir}}">
997
                    <copyfiles todir="${{build.classes.dir}}">
998
                       <xsl:attribute name="files"><xsl:value-of select="concat('${',$included.prop.name,'}')"/></xsl:attribute>
998
                       <xsl:attribute name="files"><xsl:value-of select="concat('${',$included.prop.name,'}')"/></xsl:attribute>
999
                    </copyfiles>
999
                    </copyfiles>
1000
                </xsl:for-each>   
1000
                </xsl:for-each>    -->
1001
            </target> 
1001
            </target> 
1002
            
1002
            
1003
            <target name="library-inclusion-in-manifest" depends="compile">
1003
            <target name="library-inclusion-in-manifest" depends="compile">
(-)a/j2eeserver/apichanges.xml (+22 lines)
Lines 116-121 Link Here
116
    <!-- ACTUAL CHANGES BEGIN HERE: -->
116
    <!-- ACTUAL CHANGES BEGIN HERE: -->
117
117
118
    <changes>
118
    <changes>
119
120
        <change id="required-librariers">
121
            <summary>
122
                Implement support for deployment of standalone EE modules.
123
            </summary>
124
            <version major="1" minor="69"/>
125
            <date day="2" month="8" year="2010"/>
126
            <author login="dkonecny"/>
127
            <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
128
            <description>
129
                <p>
130
                Implemented both SPI and API for communication of requires libraries
131
                from EE module to deployment server.
132
                </p>
133
            </description>
134
            <class package="org.netbeans.modules.j2ee.deployment.devmodules.api" name="J2eeModule"/>
135
            <class package="src.org.netbeans.modules.j2ee.deployment.devmodules.spi" name="J2eeModuleImplementation3"/>
136
            <class package="org.netbeans.modules.j2ee.deployment.plugins.spi" name="DeploymentManager2"/>
137
            <issue number="186331"/>
138
        </change>
139
140
119
        <change id="serverLibraries">
141
        <change id="serverLibraries">
120
	    <summary>
142
	    <summary>
121
                Implemented support for handling the server libraries.
143
                Implemented support for handling the server libraries.
(-)a/j2eeserver/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
is.autoload=true
43
is.autoload=true
44
javac.source=1.6
44
javac.source=1.6
45
spec.version.base=1.68.0
45
spec.version.base=1.69.0
46
46
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eeModule.java (+18 lines)
Lines 55-62 Link Here
55
import java.util.logging.Level;
55
import java.util.logging.Level;
56
import java.util.logging.Logger;
56
import java.util.logging.Logger;
57
import org.netbeans.api.annotations.common.NonNull;
57
import org.netbeans.api.annotations.common.NonNull;
58
import org.netbeans.api.j2ee.core.Profile;
58
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleBase;
59
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleBase;
59
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation2;
60
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation2;
61
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleImplementation3;
60
import org.netbeans.modules.j2ee.metadata.model.api.MetadataModel;
62
import org.netbeans.modules.j2ee.metadata.model.api.MetadataModel;
61
import org.openide.util.Parameters;
63
import org.openide.util.Parameters;
62
64
Lines 214-219 Link Here
214
    }
216
    }
215
217
216
    /**
218
    /**
219
     * Returns array of jar files which this EE module requires in order to be
220
     * successfully deployed.
221
     * @since org.netbeans.modules.j2eeserver/4 1.69
222
     */
223
    public File[] getRequiredLibraries() {
224
        if (impl instanceof J2eeModuleImplementation3) {
225
            File libs[] = ((J2eeModuleImplementation3) impl).getRequiredLibraries();
226
            assert libs != null;
227
            assert (getType() == J2eeModule.Type.WAR || getType() == J2eeModule.Type.EAR) ? libs.length == 0 : true;
228
            return libs;
229
        } else {
230
            return new File[0];
231
        }
232
    }
233
234
    /**
217
     * Returns module type.
235
     * Returns module type.
218
     *
236
     *
219
     * @return module type
237
     * @return module type
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/spi/J2eeModuleImplementation3.java (+64 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package org.netbeans.modules.j2ee.deployment.devmodules.spi;
46
47
import java.io.File;
48
49
/**
50
 * Standalone EJB and AppClient module can describe library jars they depend on.
51
 *
52
 * @since org.netbeans.modules.j2eeserver/4 1.69
53
 */
54
public interface J2eeModuleImplementation3 extends J2eeModuleImplementation2 {
55
56
    /**
57
     * Returns array of jar files this standalone EE module depends on.
58
     * @return never null; can be empty array; file must be absolute and
59
     * a jar file and never a folder; libraries can be returned only for EJB or
60
     * APPCLIENT module
61
     */
62
    File[] getRequiredLibraries();
63
64
}
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/TargetServer.java (-2 / +13 lines)
Lines 83-88 Link Here
83
import org.netbeans.modules.j2ee.deployment.execution.ModuleConfigurationProvider;
83
import org.netbeans.modules.j2ee.deployment.execution.ModuleConfigurationProvider;
84
import org.netbeans.modules.j2ee.deployment.impl.ui.ProgressUI;
84
import org.netbeans.modules.j2ee.deployment.impl.ui.ProgressUI;
85
import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor;
85
import org.netbeans.modules.j2ee.deployment.plugins.api.DeploymentChangeDescriptor;
86
import org.netbeans.modules.j2ee.deployment.plugins.spi.DeploymentManager2;
86
import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment;
87
import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment;
87
import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration;
88
import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfiguration;
88
import org.netbeans.modules.j2ee.deployment.plugins.spi.TargetModuleIDResolver;
89
import org.netbeans.modules.j2ee.deployment.plugins.spi.TargetModuleIDResolver;
Lines 632-638 Link Here
632
633
633
                ui.progress(NbBundle.getMessage(TargetServer.class, "MSG_Distributing", application, Arrays.asList(targetz)));
634
                ui.progress(NbBundle.getMessage(TargetServer.class, "MSG_Distributing", application, Arrays.asList(targetz)));
634
                plan = dtarget.getConfigurationFile();
635
                plan = dtarget.getConfigurationFile();
635
                po = instance.getDeploymentManager().distribute(targetz, getApplication(), plan);
636
                DeploymentManager dm = instance.getDeploymentManager();
637
                if (dm instanceof DeploymentManager2) {
638
                    po = ((DeploymentManager2)dm).distribute(targetz, getApplication(), plan, dtarget.getModule());
639
                } else {
640
                    po = dm.distribute(targetz, getApplication(), plan);
641
                }
636
                trackDeployProgressObject(ui, po, false);
642
                trackDeployProgressObject(ui, po, false);
637
            }
643
            }
638
        }
644
        }
Lines 659-665 Link Here
659
                ui.progress(NbBundle.getMessage(TargetServer.class, "MSG_Redeploying", application));
665
                ui.progress(NbBundle.getMessage(TargetServer.class, "MSG_Redeploying", application));
660
                TargetModuleID[] tmids = TargetModule.toTargetModuleID(redeployTargetModules);
666
                TargetModuleID[] tmids = TargetModule.toTargetModuleID(redeployTargetModules);
661
                if (plan == null) plan = dtarget.getConfigurationFile();
667
                if (plan == null) plan = dtarget.getConfigurationFile();
662
                po = instance.getDeploymentManager().redeploy(tmids, getApplication(), plan);
668
                DeploymentManager dm = instance.getDeploymentManager();
669
                if (dm instanceof DeploymentManager2) {
670
                    po = ((DeploymentManager2)dm).redeploy(tmids, getApplication(), plan, dtarget.getModule());
671
                } else {
672
                    po = dm.redeploy(tmids, getApplication(), plan);
673
                }
663
                trackDeployProgressObject(ui, po, false);
674
                trackDeployProgressObject(ui, po, false);
664
            }
675
            }
665
        }
676
        }
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/DeploymentManager2.java (+81 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
/*
46
 * IncrementalDeployment.java
47
 *
48
 * Created on November 14, 2003, 9:13 AM
49
 */
50
51
package org.netbeans.modules.j2ee.deployment.plugins.spi;
52
53
import javax.enterprise.deploy.spi.TargetModuleID;
54
import javax.enterprise.deploy.spi.status.ProgressObject;
55
import java.io.File;
56
import javax.enterprise.deploy.spi.DeploymentManager;
57
import javax.enterprise.deploy.spi.Target;
58
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
59
60
/**
61
 * Enhanced deployment manager capable of passing EE module description to 
62
 * redeploy and distribute methods in order to implement deployment of
63
 * standalone EE modules.
64
 *
65
 * @since org.netbeans.modules.j2eeserver/4 1.69
66
 */
67
public interface DeploymentManager2 extends DeploymentManager {
68
69
    /**
70
     * @param module EE module being deployed
71
     */
72
    public ProgressObject redeploy(TargetModuleID [] moduleIDList, final File moduleArchive, File deploymentPlan, J2eeModule module)
73
            throws UnsupportedOperationException, IllegalStateException;
74
75
    /**
76
     * @param module EE module being deployed
77
     */
78
    public ProgressObject distribute(Target[] targetList, final File moduleArchive, File deploymentPlan, J2eeModule module)
79
            throws IllegalStateException;
80
81
}

Return to bug 186331