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/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 (+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
 * 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
 */
55
public interface GlassfishModule2 extends GlassfishModule {
56
    
57
    public Future<OperationState> deploy(OperationStateListener stateListener,
58
            File application, String name, String contextRoot, Map<String,String> properties,
59
            File[] libraries);
60
61
    public Future<OperationState> redeploy(final OperationStateListener stateListener, 
62
            final String name, final String contextRoot, File[] libraries);
63
    
64
}
(-)a/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/ide/FastDeploy.java (-1 / +13 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
    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
    }
(-)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.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/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eeModule.java (+13 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 213-218 Link Here
213
        }
215
        }
214
    }
216
    }
215
217
218
    public File[] getRequiredLibraries() {
219
        if (impl instanceof J2eeModuleImplementation3) {
220
            File libs[] = ((J2eeModuleImplementation3) impl).getRequiredLibraries();
221
            assert libs != null;
222
            assert (getType() == J2eeModule.Type.WAR || getType() == J2eeModule.Type.EAR) && libs.length == 0;
223
            return libs;
224
        } else {
225
            return new File[0];
226
        }
227
    }
228
216
    /**
229
    /**
217
     * Returns module type.
230
     * Returns module type.
218
     *
231
     *
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/spi/J2eeModuleImplementation3.java (+62 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
public interface J2eeModuleImplementation3 extends J2eeModuleImplementation2 {
53
54
    /**
55
     * Returns array of jar files this standalone EE module depends on.
56
     * @return never null; can be empty array; file must be absolute and
57
     * a jar file and never a folder; libraries can be returned only for EJB or
58
     * APPCLIENT module
59
     */
60
    File[] getRequiredLibraries();
61
62
}

Return to bug 186331