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

(-)apichanges.xml (+24 lines)
Lines 80-85 Link Here
80
    <!-- ACTUAL CHANGES BEGIN HERE: -->
80
    <!-- ACTUAL CHANGES BEGIN HERE: -->
81
81
82
    <changes>
82
    <changes>
83
        <change id="j2eePlatformTools">
84
            <api name="j2eeserver"/>
85
            <summary>
86
                Added support for getting the tool properties, added constants for
87
                tools and tool properties.
88
            </summary>
89
            <version major="1" minor="TODO"/>
90
            <date day="22" month="3" year="2006"/>
91
            <author login="sherold"/>
92
            <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
93
            <description>
94
                <p>
95
                    Many tools need properties like main class or JVM options,
96
                    the getToolProperty method allows to get those properties
97
                    now, so far these properties had to be hardcoded.
98
                </p>
99
                <p>
100
                    The constats for the tools and the tool properties were added
101
                    to avoid problems that might occur if the tool string changes.
102
                </p>
103
            </description>
104
            <class package="org.netbeans.modules.j2ee.deployment.devmodules.api" name="J2eePlatform"/>
105
            <class package="org.netbeans.modules.j2ee.deployment.plugins.api" name="J2eePlatformImpl"/>
106
        </change>
83
        <change id="resourceDirUpdate">
107
        <change id="resourceDirUpdate">
84
            <api name="j2eeserver"/>
108
            <api name="j2eeserver"/>
85
            <summary>
109
            <summary>
(-)src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java (-9 / +122 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 *
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 52-57 Link Here
52
    /** Platform roots property */
52
    /** Platform roots property */
53
    public static final String PROP_PLATFORM_ROOTS = "platformRoots";   //NOI18N
53
    public static final String PROP_PLATFORM_ROOTS = "platformRoots";   //NOI18N
54
    
54
    
55
    
56
    /** 
57
     * Constant for the application runtime tool. The standard properties defined 
58
     * for this tool are as follows {@link #TOOL_PROP_MAIN_CLASS},
59
     * {@link #TOOL_PROP_MAIN_CLASS_ARGS}, {@link #TOOL_PROP_JVM_OPTS}
60
     * @since TODO 
61
     */
62
    public static final String TOOL_APP_CLIENT_RUNTIME = "appClientRuntime";     // NOI18N
63
    
64
    /** 
65
     * Constant for the JSR109 tool.
66
     * @since TODO 
67
     */
68
    public static final String TOOL_JSR109      = "jsr109";     // NOI18N
69
    
70
    /** 
71
     * Constant for the WSCOMPILE tool.
72
     * @since TODO 
73
     */
74
    public static final String TOOL_WSCOMPILE   = "wscompile";  // NOI18N
75
    
76
    /** 
77
     * Constant for the WSIMPORT tool.
78
     * @since TODO 
79
     */
80
    public static final String TOOL_WSIMPORT    = "wsimport";   // NOI18N
81
    
82
    /** 
83
     * Constant for the WSGEN tool.
84
     * @since TODO 
85
     */
86
    public static final String TOOL_WSGEN       = "wsgen";      // NOI18N
87
    
88
    /** 
89
     * Constant for the WSIT tool.
90
     * @since TODO 
91
     */
92
    public static final String TOOL_WSIT        = "wsit";       // NOI18N
93
    
94
    /** 
95
     * Constant for the JWSDP tool.
96
     * @since TODO 
97
     */
98
    public static final String TOOL_JWSDP       = "jwsdp";      // NOI18N
99
    
100
    /** 
101
     * Constant for the KEYSTORE tool.
102
     * @since TODO 
103
     */
104
    public static final String TOOL_KEYSTORE        = "keystore";       // NOI18N
105
    
106
    /** 
107
     * Constant for the KEYSTORE tool.
108
     * @since TODO 
109
     */
110
    public static final String TOOL_KEYSTORE_CLIENT = "keystoreClient"; // NOI18N
111
    
112
    /** 
113
     * Constant for the TRUSTSTORE tool.
114
     * @since TODO 
115
     */
116
    public static final String TOOL_TRUSTSTORE      = "truststore";     // NOI18N
117
    
118
    /** 
119
     * Constant for the TRUSTSTORE_CLIENT tool.
120
     * @since TODO 
121
     */
122
    public static final String TOOL_TRUSTSTORE_CLIENT = "truststoreClient";     // NOI18N
123
    
124
    /** 
125
     * Constant for the main class tool property.
126
     * @since TODO 
127
     */
128
    public static final String TOOL_PROP_MAIN_CLASS         = "main.class";     // NOI18N
129
    
130
    /** 
131
     * Constant for the main class arguments tool property.
132
     * @since TODO 
133
     */
134
    public static final String TOOL_PROP_MAIN_CLASS_ARGS    = "main.class.args"; // NOI18N
135
    
136
    /** 
137
     * Constant for the JVM options tool property.
138
     * @since TODO 
139
     */
140
    public static final String TOOL_PROP_JVM_OPTS           = "jvm.opts";       // NOI18N
141
    
142
    /**
143
     * Constant for the distribution archive client property. Some of the tool
144
     * property values may refer to this property.
145
     * @since TODO
146
     */
147
    public static final String CLIENT_PROP_DIST_ARCHIVE     = "client.dist.archive"; // NOI18N
148
55
    private static final String DEFAULT_ICON = "org/netbeans/modules/j2ee/deployment/impl/ui/resources/Servers.png"; // NOI18N
149
    private static final String DEFAULT_ICON = "org/netbeans/modules/j2ee/deployment/impl/ui/resources/Servers.png"; // NOI18N
56
    
150
    
57
    private J2eePlatformImpl impl;
151
    private J2eePlatformImpl impl;
Lines 150-158 Link Here
150
    }
244
    }
151
    
245
    
152
    /**
246
    /**
153
     * Return classpath for the specified tool.
247
     * Return classpath for the specified tool. Use the tool constants declared 
248
     * in this class.
154
     *
249
     *
155
     * @param  toolName tool's name e.g. "wscompile".
250
     * @param  toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}.
156
     * @return classpath for the specified tool.
251
     * @return classpath for the specified tool.
157
     */
252
     */
158
    public File[] getToolClasspathEntries(String toolName) {
253
    public File[] getToolClasspathEntries(String toolName) {
Lines 160-168 Link Here
160
    }
255
    }
161
    
256
    
162
    /**
257
    /**
258
     * Returns the property value for the specified tool.
259
     * <p>
260
     * The property value uses Ant property format and therefore may contain 
261
     * references to another properties defined either by the client of this API 
262
     * or by the tool itself.
263
     * <p>
264
     * The properties the client may be requited to define are as follows
265
     * {@link #CLIENT_PROP_DIST_ARCHIVE}
266
     * 
267
     * @param toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}.
268
     * @param propertyName tool property name, for example {@link #TOOL_PROP_MAIN_CLASS}.
269
     *
270
     * @return property value or null, if the property is not defined for the 
271
     *         specified tool.
272
     *         
273
     * @since TODO
274
     */
275
    public String getToolProperty(String toolName, String propertyName) {
276
        return impl.getToolProperty(toolName, propertyName);
277
    }
278
    
279
    /**
163
     * Specifies whether a tool of the given name is supported by this platform.
280
     * Specifies whether a tool of the given name is supported by this platform.
281
     * Use the tool constants declared in this class.
164
     *
282
     *
165
     * @param  toolName tool's name e.g. "wscompile".
283
     * @param  toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}.
166
     * @return <code>true</code> if platform supports tool of the given name, 
284
     * @return <code>true</code> if platform supports tool of the given name, 
167
     *         <code>false</code> otherwise.
285
     *         <code>false</code> otherwise.
168
     */
286
     */
Lines 303-311 Link Here
303
        }
421
        }
304
        return classpath.toString();
422
        return classpath.toString();
305
    }
423
    }
306
    
307
    public Object getProperty(String name) {
308
        return impl.getProperty(name);
309
    }
310
    
311
}
424
}
(-)src/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.java (-12 / +29 lines)
Lines 7-13 Link Here
7
 * http://www.sun.com/
7
 * http://www.sun.com/
8
 *
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
12
 */
13
13
Lines 18-26 Link Here
18
import java.beans.PropertyChangeListener;
18
import java.beans.PropertyChangeListener;
19
import java.beans.PropertyChangeSupport;
19
import java.beans.PropertyChangeSupport;
20
import java.io.File;
20
import java.io.File;
21
import java.util.Hashtable;
21
import java.util.Collections;
22
import java.util.Set;
22
import java.util.Set;
23
import org.netbeans.api.java.platform.JavaPlatform;
23
import org.netbeans.api.java.platform.JavaPlatform;
24
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform;
24
import org.netbeans.spi.project.libraries.LibraryImplementation;
25
import org.netbeans.spi.project.libraries.LibraryImplementation;
25
26
26
/**
27
/**
Lines 74-90 Link Here
74
    public abstract File[] getPlatformRoots();
75
    public abstract File[] getPlatformRoots();
75
    
76
    
76
    /**
77
    /**
77
     * Return classpath for the specified tool.
78
     * Return classpath for the specified tool. Use the tool constants declared 
79
     * in the {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform}.
78
     *
80
     *
79
     * @param  toolName tool's name e.g. "wscompile".
81
     * @param  toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME}.
80
     * @return classpath for the specified tool.
82
     * @return classpath for the specified tool.
81
     */
83
     */
82
    public abstract File[] getToolClasspathEntries(String toolName);
84
    public abstract File[] getToolClasspathEntries(String toolName);
83
    
85
    
84
    /**
86
    /**
85
     * Specifies whether a tool of the given name is supported by this platform.
87
     * Specifies whether a tool of the given name is supported by this platform.
88
     * Use the tool constants declared in the {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform}.
86
     *
89
     *
87
     * @param  toolName tool's name e.g. "wscompile".
90
     * @param  toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME}
91
     * .
88
     * @return <code>true</code> if platform supports tool of the given name, 
92
     * @return <code>true</code> if platform supports tool of the given name, 
89
     *         <code>false</code> otherwise.
93
     *         <code>false</code> otherwise.
90
     */
94
     */
Lines 163-175 Link Here
163
        if (supp != null)
167
        if (supp != null)
164
            supp.firePropertyChange(propName, oldValue, newValue);
168
            supp.firePropertyChange(propName, oldValue, newValue);
165
    }
169
    }
166
    
170
167
    //jungi: this is for testing purposes only and it should be done in some
171
    /**
168
    //better way
172
     * Returns the property value for the specified tool.
169
    //it is used for communication between j2ee/clientproject and serverplugins
173
     * <p>
170
    //only one method will be (maybe) enough
174
     * The property value uses Ant property format and therefore may contain 
171
    //it has not been declared "abstract" for backward compatibility reasons
175
     * references to another properties defined either by the client of this API 
172
    public Object getProperty(String name) {
176
     * or by the tool itself.
177
     * <p>
178
     * The properties the client may be requited to define are as follows
179
     * {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#CLIENT_PROP_DIST_ARCHIVE}
180
     * 
181
     * @param toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME}.
182
     * @param propertyName tool property name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_PROP_MAIN_CLASS}.
183
     *
184
     * @return property value or null, if the property is not defined for the 
185
     *         specified tool.
186
     *         
187
     * @since TODO
188
     */
189
    public String getToolProperty(String toolName, String propertyName) {
173
        return null;
190
        return null;
174
    }
191
    }
175
}
192
}

Return to bug 73371