diff -r 0cdf98b4e6f6 j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java --- a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java Fri Feb 29 18:11:55 2008 -0800 +++ b/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java Mon Mar 03 12:06:45 2008 -0800 @@ -251,6 +251,7 @@ public abstract class InstanceProperties * instance does not exists * @throws InstanceCreationException when instance with same url already * registered + * @see #removeInstance(String url) * @since 1.37.0 */ public static InstanceProperties createInstancePropertiesWithoutUI(String url, String username, @@ -262,6 +263,25 @@ public abstract class InstanceProperties return ip; } + /** + * Removes the given server instance from the JavaEE server registry, + * making it unavailable to JavaEE projects. + * + * It the responsibility of the caller to make any changes in server state + * (e.g. stopping the server) that might be desired or required before + * calling this method. + * + * This method is intended to allow server plugins that registered a JavaEE + * server instance via {@link #createInstancePropertiesWithoutUI(String url, String username, String password, String displayName, Map initialProperties) createInstancePropertiesWithoutUI} + * to remove those instances later. + * + * @param url the url connection string to get the instance deployment manager + * @since 1.41.0 + */ + public static void removeInstance(String url) { + ServerRegistry.getInstance().removeServerInstance(url); + } + /** * Returns list of URL strings of all registered instances * @return array of URL strings