? api.proposal.diff ? api.proposal1.diff ? api.proposal2.diff ? authentication.dif ? authentication.diff ? changes.diff ? changes1.diff ? customizer_support.diff ? ds_review.diff ? icon.diff ? kolecko.diff ? src/org/netbeans/modules/j2ee/deployment/config/J2eeApplicationObjectImpl.java1 ? src/org/netbeans/modules/j2ee/deployment/impl/ProxyAuthenticator.java1 ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/ear.png ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/earBadge.gif ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/ejb.png ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/ejbBadge.png ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/war.png ? src/org/netbeans/modules/j2ee/deployment/impl/ui/resources/warBadge.gif ? src/org/netbeans/modules/j2ee/deployment/plugins/api/CustomizerSupport.java1 ? src/org/netbeans/modules/j2ee/deployment/plugins/api/ServerAuthenticator.java1 ? test/unit/src/org/netbeans/modules/j2ee/deployment/plugins Index: apichanges.xml =================================================================== RCS file: /cvs/j2eeserver/apichanges.xml,v retrieving revision 1.16.6.3 diff -u -r1.16.6.3 apichanges.xml --- apichanges.xml 2 Nov 2005 03:09:05 -0000 1.16.6.3 +++ apichanges.xml 28 Mar 2006 09:04:23 -0000 @@ -80,6 +80,30 @@ + + + + Added support for getting the tool properties, added constants for + tools and tool properties. + + + + + + +

+ Many tools need properties like main class or JVM options, + the getToolProperty method allows to get those properties + now, so far these properties had to be hardcoded. +

+

+ The constats for the tools and the tool properties were added + to avoid problems that might occur if the tool string changes. +

+
+ + +
Index: src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java =================================================================== RCS file: /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java,v retrieving revision 1.7.6.1.2.1 diff -u -r1.7.6.1.2.1 J2eePlatform.java --- src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java 5 Mar 2006 14:05:41 -0000 1.7.6.1.2.1 +++ src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java 28 Mar 2006 09:04:23 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -52,6 +52,100 @@ /** Platform roots property */ public static final String PROP_PLATFORM_ROOTS = "platformRoots"; //NOI18N + + /** + * Constant for the application runtime tool. The standard properties defined + * for this tool are as follows {@link #TOOL_PROP_MAIN_CLASS}, + * {@link #TOOL_PROP_MAIN_CLASS_ARGS}, {@link #TOOL_PROP_JVM_OPTS} + * @since TODO + */ + public static final String TOOL_APP_CLIENT_RUNTIME = "appClientRuntime"; // NOI18N + + /** + * Constant for the JSR109 tool. + * @since TODO + */ + public static final String TOOL_JSR109 = "jsr109"; // NOI18N + + /** + * Constant for the WSCOMPILE tool. + * @since TODO + */ + public static final String TOOL_WSCOMPILE = "wscompile"; // NOI18N + + /** + * Constant for the WSIMPORT tool. + * @since TODO + */ + public static final String TOOL_WSIMPORT = "wsimport"; // NOI18N + + /** + * Constant for the WSGEN tool. + * @since TODO + */ + public static final String TOOL_WSGEN = "wsgen"; // NOI18N + + /** + * Constant for the WSIT tool. + * @since TODO + */ + public static final String TOOL_WSIT = "wsit"; // NOI18N + + /** + * Constant for the JWSDP tool. + * @since TODO + */ + public static final String TOOL_JWSDP = "jwsdp"; // NOI18N + + /** + * Constant for the KEYSTORE tool. + * @since TODO + */ + public static final String TOOL_KEYSTORE = "keystore"; // NOI18N + + /** + * Constant for the KEYSTORE tool. + * @since TODO + */ + public static final String TOOL_KEYSTORE_CLIENT = "keystoreClient"; // NOI18N + + /** + * Constant for the TRUSTSTORE tool. + * @since TODO + */ + public static final String TOOL_TRUSTSTORE = "truststore"; // NOI18N + + /** + * Constant for the TRUSTSTORE_CLIENT tool. + * @since TODO + */ + public static final String TOOL_TRUSTSTORE_CLIENT = "truststoreClient"; // NOI18N + + /** + * Constant for the main class tool property. + * @since TODO + */ + public static final String TOOL_PROP_MAIN_CLASS = "main.class"; // NOI18N + + /** + * Constant for the main class arguments tool property. + * @since TODO + */ + public static final String TOOL_PROP_MAIN_CLASS_ARGS = "main.class.args"; // NOI18N + + /** + * Constant for the JVM options tool property. + * @since TODO + */ + public static final String TOOL_PROP_JVM_OPTS = "jvm.opts"; // NOI18N + + /** + * Constant for the distribution archive client property. Some of the tool + * property values may refer to this property. + * @since TODO + */ + public static final String CLIENT_PROP_DIST_ARCHIVE = "client.dist.archive"; // NOI18N + private static final String DEFAULT_ICON = "org/netbeans/modules/j2ee/deployment/impl/ui/resources/Servers.png"; // NOI18N private J2eePlatformImpl impl; @@ -150,9 +244,10 @@ } /** - * Return classpath for the specified tool. + * Return classpath for the specified tool. Use the tool constants declared + * in this class. * - * @param toolName tool's name e.g. "wscompile". + * @param toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}. * @return classpath for the specified tool. */ public File[] getToolClasspathEntries(String toolName) { @@ -160,9 +255,32 @@ } /** + * Returns the property value for the specified tool. + *

+ * The property value uses Ant property format and therefore may contain + * references to another properties defined either by the client of this API + * or by the tool itself. + *

+ * The properties the client may be requited to define are as follows + * {@link #CLIENT_PROP_DIST_ARCHIVE} + * + * @param toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}. + * @param propertyName tool property name, for example {@link #TOOL_PROP_MAIN_CLASS}. + * + * @return property value or null, if the property is not defined for the + * specified tool. + * + * @since TODO + */ + public String getToolProperty(String toolName, String propertyName) { + return impl.getToolProperty(toolName, propertyName); + } + + /** * Specifies whether a tool of the given name is supported by this platform. + * Use the tool constants declared in this class. * - * @param toolName tool's name e.g. "wscompile". + * @param toolName tool name, for example {@link #TOOL_APP_CLIENT_RUNTIME}. * @return true if platform supports tool of the given name, * false otherwise. */ @@ -303,9 +421,4 @@ } return classpath.toString(); } - - public Object getProperty(String name) { - return impl.getProperty(name); - } - } Index: src/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.java =================================================================== RCS file: /cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.java,v retrieving revision 1.3.42.1.2.2 diff -u -r1.3.42.1.2.2 J2eePlatformImpl.java --- src/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.java 6 Mar 2006 01:36:04 -0000 1.3.42.1.2.2 +++ src/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.java 28 Mar 2006 09:04:23 -0000 @@ -7,7 +7,7 @@ * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. */ @@ -18,9 +18,10 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.File; -import java.util.Hashtable; +import java.util.Collections; import java.util.Set; import org.netbeans.api.java.platform.JavaPlatform; +import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform; import org.netbeans.spi.project.libraries.LibraryImplementation; /** @@ -74,17 +75,20 @@ public abstract File[] getPlatformRoots(); /** - * Return classpath for the specified tool. + * Return classpath for the specified tool. Use the tool constants declared + * in the {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform}. * - * @param toolName tool's name e.g. "wscompile". + * @param toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME}. * @return classpath for the specified tool. */ public abstract File[] getToolClasspathEntries(String toolName); /** * Specifies whether a tool of the given name is supported by this platform. + * Use the tool constants declared in the {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform}. * - * @param toolName tool's name e.g. "wscompile". + * @param toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME} + * . * @return true if platform supports tool of the given name, * false otherwise. */ @@ -163,13 +167,26 @@ if (supp != null) supp.firePropertyChange(propName, oldValue, newValue); } - - //jungi: this is for testing purposes only and it should be done in some - //better way - //it is used for communication between j2ee/clientproject and serverplugins - //only one method will be (maybe) enough - //it has not been declared "abstract" for backward compatibility reasons - public Object getProperty(String name) { + + /** + * Returns the property value for the specified tool. + *

+ * The property value uses Ant property format and therefore may contain + * references to another properties defined either by the client of this API + * or by the tool itself. + *

+ * The properties the client may be requited to define are as follows + * {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#CLIENT_PROP_DIST_ARCHIVE} + * + * @param toolName tool name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_APP_CLIENT_RUNTIME}. + * @param propertyName tool property name, for example {@link org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform#TOOL_PROP_MAIN_CLASS}. + * + * @return property value or null, if the property is not defined for the + * specified tool. + * + * @since TODO + */ + public String getToolProperty(String toolName, String propertyName) { return null; } }