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 206196
Collapse All | Expand All

(-)a/glassfish.common/nbproject/project.xml (-1 / +1 lines)
Lines 54-60 Link Here
54
                    <compile-dependency/>
54
                    <compile-dependency/>
55
                    <run-dependency>
55
                    <run-dependency>
56
                        <release-version>0</release-version>
56
                        <release-version>0</release-version>
57
                        <specification-version>1.2</specification-version>
57
                        <specification-version>1.18</specification-version>
58
                    </run-dependency>
58
                    </run-dependency>
59
                </dependency>
59
                </dependency>
60
                <dependency>
60
                <dependency>
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java (+9 lines)
Lines 62-67 Link Here
62
import java.util.logging.Level;
62
import java.util.logging.Level;
63
import java.util.logging.Logger;
63
import java.util.logging.Logger;
64
import javax.swing.SwingUtilities;
64
import javax.swing.SwingUtilities;
65
import org.netbeans.api.server.VMArguments;
65
import org.netbeans.modules.glassfish.spi.RegisteredDerbyServer;
66
import org.netbeans.modules.glassfish.spi.RegisteredDerbyServer;
66
import org.netbeans.modules.glassfish.spi.GlassfishModule;
67
import org.netbeans.modules.glassfish.spi.GlassfishModule;
67
import org.netbeans.modules.glassfish.spi.GlassfishModule.OperationState;
68
import org.netbeans.modules.glassfish.spi.GlassfishModule.OperationState;
Lines 696-701 Link Here
696
            throw new ProcessCreationException(ioe,
697
            throw new ProcessCreationException(ioe,
697
                    "MSG_START_SERVER_FAILED_INVALIDPORT", instanceName, debugPortString); //NOI18N
698
                    "MSG_START_SERVER_FAILED_INVALIDPORT", instanceName, debugPortString); //NOI18N
698
        }
699
        }
700
701
        if (!GlassfishModule.PROFILE_MODE.equals(ip.get(GlassfishModule.JVM_MODE))) {
702
            for (VMArguments args : VMArguments.getVMArguments()) {
703
                for (String singleArg : args.getArguments()) {
704
                    argumentBuf.append(' ').append(singleArg);
705
                }
706
            }
707
        }
699
        return argumentBuf;
708
        return argumentBuf;
700
    }
709
    }
701
710
(-)a/j2ee.jboss4/nbproject/project.xml (+9 lines)
Lines 162-167 Link Here
162
                    </run-dependency>
162
                    </run-dependency>
163
                </dependency>
163
                </dependency>
164
                <dependency>
164
                <dependency>
165
                    <code-name-base>org.netbeans.modules.server</code-name-base>
166
                    <build-prerequisite/>
167
                    <compile-dependency/>
168
                    <run-dependency>
169
                        <release-version>0-1</release-version>
170
                        <specification-version>1.18</specification-version>
171
                    </run-dependency>
172
                </dependency>
173
                <dependency>
165
                    <code-name-base>org.openide.actions</code-name-base>
174
                    <code-name-base>org.openide.actions</code-name-base>
166
                    <build-prerequisite/>
175
                    <build-prerequisite/>
167
                    <compile-dependency/>
176
                    <compile-dependency/>
(-)a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java (+9 lines)
Lines 62-67 Link Here
62
import javax.enterprise.deploy.shared.CommandType;
62
import javax.enterprise.deploy.shared.CommandType;
63
import javax.enterprise.deploy.shared.StateType;
63
import javax.enterprise.deploy.shared.StateType;
64
import org.netbeans.api.java.platform.JavaPlatform;
64
import org.netbeans.api.java.platform.JavaPlatform;
65
import org.netbeans.api.server.VMArguments;
65
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
66
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
66
import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
67
import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
67
import org.netbeans.modules.j2ee.deployment.profiler.api.ProfilerServerSettings;
68
import org.netbeans.modules.j2ee.deployment.profiler.api.ProfilerServerSettings;
Lines 229-234 Link Here
229
            }
230
            }
230
        }
231
        }
231
232
233
        if (startServer.getMode() != JBStartServer.MODE.PROFILE) {
234
            for (VMArguments args : VMArguments.getVMArguments()) {
235
                for (String singleArg : args.getArguments()) {
236
                    javaOptsBuilder.append(' ').append(singleArg);
237
                }
238
            }
239
        }
240
232
        // create new environment for server
241
        // create new environment for server
233
        javaOpts = javaOptsBuilder.toString();
242
        javaOpts = javaOptsBuilder.toString();
234
        String javaHome = getJavaHome(platform);
243
        String javaHome = getJavaHome(platform);
(-)a/j2ee.weblogic9/nbproject/project.xml (+9 lines)
Lines 204-209 Link Here
204
                    </run-dependency>
204
                    </run-dependency>
205
                </dependency>
205
                </dependency>
206
                <dependency>
206
                <dependency>
207
                    <code-name-base>org.netbeans.modules.server</code-name-base>
208
                    <build-prerequisite/>
209
                    <compile-dependency/>
210
                    <run-dependency>
211
                        <release-version>0-1</release-version>
212
                        <specification-version>1.18</specification-version>
213
                    </run-dependency>
214
                </dependency>
215
                <dependency>
207
                    <code-name-base>org.openide.actions</code-name-base>
216
                    <code-name-base>org.openide.actions</code-name-base>
208
                    <build-prerequisite/>
217
                    <build-prerequisite/>
209
                    <compile-dependency/>
218
                    <compile-dependency/>
(-)a/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/optional/WLStartServer.java (-3 / +16 lines)
Lines 70-75 Link Here
70
import org.netbeans.api.extexecution.input.InputReaderTask;
70
import org.netbeans.api.extexecution.input.InputReaderTask;
71
import org.netbeans.api.extexecution.input.InputReaders;
71
import org.netbeans.api.extexecution.input.InputReaders;
72
import org.netbeans.api.java.platform.JavaPlatform;
72
import org.netbeans.api.java.platform.JavaPlatform;
73
import org.netbeans.api.server.VMArguments;
73
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
74
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
74
import org.netbeans.modules.j2ee.deployment.plugins.api.ServerDebugInfo;
75
import org.netbeans.modules.j2ee.deployment.plugins.api.ServerDebugInfo;
75
import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
76
import org.netbeans.modules.j2ee.deployment.plugins.api.UISupport;
Lines 476-481 Link Here
476
            javaOptsBuilder.append("-Xdebug -Xnoagent -Djava.compiler=none ");  // NOI18N
477
            javaOptsBuilder.append("-Xdebug -Xnoagent -Djava.compiler=none ");  // NOI18N
477
            javaOptsBuilder.append("-Xrunjdwp:server=y,suspend=n,transport=dt_socket,address=");// NOI18N
478
            javaOptsBuilder.append("-Xrunjdwp:server=y,suspend=n,transport=dt_socket,address=");// NOI18N
478
            javaOptsBuilder.append( debugPort );
479
            javaOptsBuilder.append( debugPort );
480
            for (VMArguments args : VMArguments.getVMArguments()) {
481
                for (String singleArg : args.getArguments()) {
482
                    javaOptsBuilder.append(' ').append(singleArg);
483
                }
484
            }
479
            ExternalProcessBuilder result = builder.addEnvironmentVariable(
485
            ExternalProcessBuilder result = builder.addEnvironmentVariable(
480
                    JAVA_OPTIONS_VARIABLE,
486
                    JAVA_OPTIONS_VARIABLE,
481
                    javaOptsBuilder.toString());   
487
                    javaOptsBuilder.toString());   
Lines 657-665 Link Here
657
        {
663
        {
658
            ExternalProcessBuilder result = builder;
664
            ExternalProcessBuilder result = builder;
659
            String javaOpts = dm.getInstanceProperties().getProperty(WLPluginProperties.JAVA_OPTS);
665
            String javaOpts = dm.getInstanceProperties().getProperty(WLPluginProperties.JAVA_OPTS);
660
            if ( javaOpts!= null && javaOpts.trim().length() >0 ){
666
            StringBuilder sb = new StringBuilder((javaOpts!= null && javaOpts.trim().length() > 0)
661
                result = builder.addEnvironmentVariable(JAVA_OPTIONS_VARIABLE,          
667
                    ? javaOpts.trim() : "");
662
                        javaOpts.trim());
668
            for (VMArguments args : VMArguments.getVMArguments()) {
669
                for (String singleArg : args.getArguments()) {
670
                    sb.append(' ').append(singleArg);
671
                }
672
            }
673
            if (sb.length() > 0) {
674
                result = builder.addEnvironmentVariable(JAVA_OPTIONS_VARIABLE,
675
                        sb.toString());
663
            }
676
            }
664
            return result;
677
            return result;
665
        }
678
        }
(-)a/server/apichanges.xml (+16 lines)
Lines 110-115 Link Here
110
    <!-- ACTUAL CHANGES BEGIN HERE: -->
110
    <!-- ACTUAL CHANGES BEGIN HERE: -->
111
111
112
    <changes>
112
    <changes>
113
        <change id="vm.arguments">
114
            <api name="common_server_api"/>
115
            <summary>SPI to allow passing additional arguments to server VM</summary>
116
            <version major="1" minor="18"/>
117
            <date day="22" month="12" year="2011"/>
118
            <author login="phejl"/>
119
            <compatibility addition="yes"/>
120
            <description>
121
                This API/SPI allow third party plugins (such as JRebel) to
122
                register providers of VM arguments. The server plugin may
123
                optionaly query such arguments and pass them to server VM.
124
            </description>
125
            <class package="org.netbeans.api.server" name="VMArguments"/>
126
            <class package="org.netbeans.spi.server" name="VMArgumentsProvider"/>
127
            <issue number="206196"/>
128
        </change>
113
        <change id="cloud">
129
        <change id="cloud">
114
            <api name="common_server_api"/>
130
            <api name="common_server_api"/>
115
            <summary>Establish layer to register cloud providers</summary>
131
            <summary>Establish layer to register cloud providers</summary>
(-)a/server/arch.xml (-2 / +24 lines)
Lines 60-66 Link Here
60
  </p>  
60
  </p>  
61
  <p>
61
  <p>
62
   Clients can provide its instances through the SPI. They can also provide
62
   Clients can provide its instances through the SPI. They can also provide
63
   wizards to define UI way for the server or cloud instance addition. It is done with
63
   wizards to define UI way for the server or cloud instance addition. There
64
   is also provider of VM arguments which can be registered in layer. It is done with
64
   <api group="layer" name="CommonServerLayerSPI" type="export" category="devel" url="@TOP@overview-summary.html"/>
65
   <api group="layer" name="CommonServerLayerSPI" type="export" category="devel" url="@TOP@overview-summary.html"/>
65
   where the SPIs implementation must be registered.
66
   where the SPIs implementation must be registered.
66
  </p>
67
  </p>
Lines 81-86 Link Here
81
            can extend the list of popup actions on Cloud node in
82
            can extend the list of popup actions on Cloud node in
82
            Services tab.
83
            Services tab.
83
      </api>
84
      </api>
85
      <api group="layer" name="VMArgumentsProvider" type="export" category="devel">
86
            By registering providers to <code>Servers/VMArgumentsProviders</code> you
87
            can register your additional VM arguments provider.
88
      </api>
84
      <api group="property" name="serverNodeHidden" type="export" category="friend">
89
      <api group="property" name="serverNodeHidden" type="export" category="friend">
85
            If the action registered in <code>Servers/Actions</code> or <code>Cloud/Actions</code> folder
90
            If the action registered in <code>Servers/Actions</code> or <code>Cloud/Actions</code> folder
86
            has <code>getValue("serverNodeHidden") == Boolean.TRUE</code>, then
91
            has <code>getValue("serverNodeHidden") == Boolean.TRUE</code>, then
Lines 236-242 Link Here
236
    can be used. It provides a way how to store and retrieve properties of
241
    can be used. It provides a way how to store and retrieve properties of
237
    the server instance.
242
    the server instance.
238
   </p>
243
   </p>
239
  </usecase>   
244
  </usecase>
245
  <usecase id="vm-arguments" name="Providing additional VM arguments">
246
   <p>
247
    The third party plugin may want to be able provide additional VM arguments
248
    for the server VM in a standardized way. In order to do so it will register
249
    a implementation of
250
    <a href="@TOP@org/netbeans/spi/server/VMArgumentsProvider.html">VMArgumentsProvider</a>
251
    to the layer folder Servers/VMArgumentProviders. The annotation
252
    <a href="@TOP@org/netbeans/spi/server/VMArgumentsProvider.Registration.html">VMArgumentsProvider.Registration</a>
253
    can be used for that.
254
   </p>
255
   <p>
256
    The clients (server plugin implementations) may query the providers via the
257
    API class
258
    <a href="@TOP@org/netbeans/spi/server/VMArguments.html">VMArguments</a>
259
    and use the additional arguments for the VM.
260
   </p>
261
  </usecase>
240
 </answer>
262
 </answer>
241
263
242
264
(-)a/server/manifest.mf (-1 / +1 lines)
Lines 2-8 Link Here
2
OpenIDE-Module: org.netbeans.modules.server/0
2
OpenIDE-Module: org.netbeans.modules.server/0
3
OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.17
5
OpenIDE-Module-Specification-Version: 1.18
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
OpenIDE-Module-Provides: org.netbeans.modules.server
7
OpenIDE-Module-Provides: org.netbeans.modules.server
8
8
(-)a/server/nbproject/project.xml (-9 / +18 lines)
Lines 50-55 Link Here
50
            <code-name-base>org.netbeans.modules.server</code-name-base>
50
            <code-name-base>org.netbeans.modules.server</code-name-base>
51
            <module-dependencies>
51
            <module-dependencies>
52
                <dependency>
52
                <dependency>
53
                    <code-name-base>org.netbeans.api.annotations.common</code-name-base>
54
                    <build-prerequisite/>
55
                    <compile-dependency/>
56
                    <run-dependency>
57
                        <release-version>1</release-version>
58
                        <specification-version>1.13</specification-version>
59
                    </run-dependency>
60
                </dependency>
61
                <dependency>
62
                    <code-name-base>org.netbeans.core.ide</code-name-base>
63
                    <build-prerequisite/>
64
                    <compile-dependency/>
65
                    <run-dependency>
66
                        <release-version>1</release-version>
67
                        <specification-version>1.15</specification-version>
68
                    </run-dependency>
69
                </dependency>
70
                <dependency>
53
                    <code-name-base>org.openide.awt</code-name-base>
71
                    <code-name-base>org.openide.awt</code-name-base>
54
                    <build-prerequisite/>
72
                    <build-prerequisite/>
55
                    <compile-dependency/>
73
                    <compile-dependency/>
Lines 98-112 Link Here
98
                    </run-dependency>
116
                    </run-dependency>
99
                </dependency>
117
                </dependency>
100
                <dependency>
118
                <dependency>
101
                    <code-name-base>org.netbeans.core.ide</code-name-base>
102
                    <build-prerequisite/>
103
                    <compile-dependency/>
104
                    <run-dependency>
105
                        <release-version>1</release-version>
106
                        <specification-version>1.15</specification-version>
107
                    </run-dependency>
108
                </dependency>
109
                <dependency>
110
                    <code-name-base>org.openide.util</code-name-base>
119
                    <code-name-base>org.openide.util</code-name-base>
111
                    <build-prerequisite/>
120
                    <build-prerequisite/>
112
                    <compile-dependency/>
121
                    <compile-dependency/>
(-)0dc0caf347b4 (+107 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 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 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.api.server;
43
44
import java.util.ArrayList;
45
import java.util.List;
46
import org.netbeans.api.annotations.common.NonNull;
47
import org.netbeans.modules.server.annotations.VMArgumentsRegistrationProcessor;
48
import org.netbeans.spi.server.VMArgumentsProvider;
49
import org.openide.util.Lookup;
50
import org.openide.util.lookup.Lookups;
51
52
/**
53
 * The API class allowing clients, typically server plugins, to query additional
54
 * groups of arguments it may pass to VM.
55
 *
56
 * @author Petr Hejl
57
 * @since 1.18
58
 * @see VMArgumentsProvider
59
 */
60
public final class VMArguments {
61
62
    private final String description;
63
64
    private final List<String> arguments;
65
66
    private VMArguments(String description, List<String> arguments) {
67
        this.description = description;
68
        this.arguments = arguments;
69
    }
70
71
    /**
72
     * Returns the groups of arguments provided by all registered
73
     * {@link VMArgumentsProvider}.
74
     *
75
     * @return the groups of arguments provided by all registered
76
     *             {@link VMArgumentsProvider}
77
     */
78
    @NonNull
79
    public static List<VMArguments> getVMArguments() {
80
        Lookup lkp = Lookups.forPath(VMArgumentsRegistrationProcessor.PATH);
81
        List<VMArguments> res = new ArrayList<VMArguments>();
82
        for (VMArgumentsProvider prov : lkp.lookupAll(VMArgumentsProvider.class)) {
83
            res.add(new VMArguments(prov.getDescription(), prov.getArguments()));
84
        }
85
        return res;
86
    }
87
88
    /**
89
     * Returns the description of group of arguments.
90
     *
91
     * @return the description of group of arguments
92
     */
93
    @NonNull
94
    public String getDescription() {
95
        return description;
96
    }
97
98
    /**
99
     * The list of the VM arguments.
100
     *
101
     * @return list of the VM arguments
102
     */
103
    @NonNull
104
    public List<String> getArguments() {
105
        return arguments;
106
    }
107
}
(-)0dc0caf347b4 (+82 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 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 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.server.annotations;
43
44
import java.util.Set;
45
import javax.annotation.processing.Processor;
46
import javax.annotation.processing.RoundEnvironment;
47
import javax.annotation.processing.SupportedAnnotationTypes;
48
import javax.annotation.processing.SupportedSourceVersion;
49
import javax.lang.model.SourceVersion;
50
import javax.lang.model.element.Element;
51
import javax.lang.model.element.TypeElement;
52
import javax.lang.model.type.TypeMirror;
53
import org.netbeans.spi.server.VMArgumentsProvider;
54
import org.openide.filesystems.annotations.LayerBuilder.File;
55
import org.openide.filesystems.annotations.LayerGeneratingProcessor;
56
import org.openide.filesystems.annotations.LayerGenerationException;
57
import org.openide.util.lookup.ServiceProvider;
58
59
/**
60
 *
61
 * @author Petr Hejl
62
 */
63
@SupportedAnnotationTypes("org.netbeans.spi.server.VMArgumentsProvider.Registration")
64
@ServiceProvider(service = Processor.class)
65
@SupportedSourceVersion(SourceVersion.RELEASE_6)
66
public class VMArgumentsRegistrationProcessor extends LayerGeneratingProcessor {
67
68
    public static final String PATH = "Servers/VmArgumentProviders";
69
70
    @Override
71
    protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {
72
        for (Element element : roundEnv.getElementsAnnotatedWith(
73
                VMArgumentsProvider.Registration.class)) {
74
75
            File f = layer(element).instanceFile(PATH, null, VMArgumentsProvider.class)
76
                    .intvalue("position", element.getAnnotation(VMArgumentsProvider.Registration.class).position());
77
            f.write();
78
        }
79
        return true;
80
    }
81
82
}
(-)0dc0caf347b4 (+94 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 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 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.server;
43
44
import java.lang.annotation.ElementType;
45
import java.lang.annotation.Retention;
46
import java.lang.annotation.RetentionPolicy;
47
import java.lang.annotation.Target;
48
import java.util.List;
49
import org.netbeans.api.annotations.common.NonNull;
50
import org.netbeans.api.server.VMArguments;
51
52
/**
53
 * Provides the additional arguments to server VM. Typically the server plugin
54
 * implementor will query the arguments via API counterpart {@link VMArguments}.
55
 * Of course it is not mandatary for server plugin to use such arguments and
56
 * there is no way to force it.
57
 *
58
 * @author Petr Hejl
59
 * @since 1.18
60
 * @see VMArguments
61
 */
62
public interface VMArgumentsProvider {
63
64
    /**
65
     * Returns the description of the provider. For example this might be
66
     * "JRebel", "Profiler" etc.
67
     *
68
     * @return the description of the provider
69
     */
70
    @NonNull
71
    String getDescription();
72
73
    /**
74
     * Returns the list of arguments to pass to the server VM.
75
     *
76
     * @return the list of arguments to pass to the server VM
77
     */
78
    @NonNull
79
    List<String> getArguments();
80
81
    /**
82
     * Annotation used to properly register the SPI implementations.
83
     */
84
    @Retention(RetentionPolicy.SOURCE)
85
    @Target({ElementType.TYPE, ElementType.METHOD})
86
    public @interface Registration {
87
88
        /**
89
         * Position of the provider in the list of providers.
90
         */
91
        int position() default Integer.MAX_VALUE;
92
93
    }
94
}
(-)a/tomcat5/nbproject/project.xml (+9 lines)
Lines 213-218 Link Here
213
                    </run-dependency>
213
                    </run-dependency>
214
                </dependency>
214
                </dependency>
215
                <dependency>
215
                <dependency>
216
                    <code-name-base>org.netbeans.modules.server</code-name-base>
217
                    <build-prerequisite/>
218
                    <compile-dependency/>
219
                    <run-dependency>
220
                        <release-version>0-1</release-version>
221
                        <specification-version>1.18</specification-version>
222
                    </run-dependency>
223
                </dependency>
224
                <dependency>
216
                    <code-name-base>org.openide.actions</code-name-base>
225
                    <code-name-base>org.openide.actions</code-name-base>
217
                    <build-prerequisite/>
226
                    <build-prerequisite/>
218
                    <compile-dependency/>
227
                    <compile-dependency/>
(-)a/tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java (+9 lines)
Lines 54-59 Link Here
54
import java.io.InputStream;
54
import java.io.InputStream;
55
import java.util.Collections;
55
import java.util.Collections;
56
import java.util.HashMap;
56
import java.util.HashMap;
57
import java.util.List;
57
import java.util.Map;
58
import java.util.Map;
58
import java.util.logging.Level;
59
import java.util.logging.Level;
59
import java.util.logging.Logger;
60
import java.util.logging.Logger;
Lines 69-74 Link Here
69
import javax.enterprise.deploy.spi.status.ProgressListener;
70
import javax.enterprise.deploy.spi.status.ProgressListener;
70
import javax.enterprise.deploy.spi.status.ProgressObject;
71
import javax.enterprise.deploy.spi.status.ProgressObject;
71
import org.netbeans.api.java.platform.JavaPlatform;
72
import org.netbeans.api.java.platform.JavaPlatform;
73
import org.netbeans.api.server.VMArguments;
72
import org.netbeans.modules.tomcat5.progress.ProgressEventSupport;
74
import org.netbeans.modules.tomcat5.progress.ProgressEventSupport;
73
import org.netbeans.modules.tomcat5.progress.Status;
75
import org.netbeans.modules.tomcat5.progress.Status;
74
import org.netbeans.modules.tomcat5.util.LogManager;
76
import org.netbeans.modules.tomcat5.util.LogManager;
Lines 398-403 Link Here
398
                        }
400
                        }
399
                    }
401
                    }
400
                }
402
                }
403
                if (mode != MODE_PROFILE) {
404
                    for (VMArguments args : VMArguments.getVMArguments()) {
405
                        for (String singleArg : args.getArguments()) {
406
                            sb.append(' ').append(singleArg);
407
                        }
408
                    }
409
                }
401
                javaOpts = sb.toString();
410
                javaOpts = sb.toString();
402
            }
411
            }
403
            
412
            

Return to bug 206196