diff -r 79437956065f j2eeserver/apichanges.xml --- a/j2eeserver/apichanges.xml Mon Mar 03 13:58:03 2008 +0100 +++ b/j2eeserver/apichanges.xml Tue Mar 04 15:16:56 2008 +0100 @@ -111,6 +111,23 @@ is the proper place. + + + + Provides a way to remove server without need to invoke UI action. + + + + + + +

+ Method provides a way to remove server instance for plugins + which don't use the j2eeserver UI. +

+
+ +
diff -r 79437956065f j2eeserver/nbproject/project.properties --- a/j2eeserver/nbproject/project.properties Mon Mar 03 13:58:03 2008 +0100 +++ b/j2eeserver/nbproject/project.properties Tue Mar 04 15:16:56 2008 +0100 @@ -39,7 +39,7 @@ is.autoload=true javac.source=1.5 -spec.version.base=1.40.0 +spec.version.base=1.41.0 javadoc.overview=${basedir}/api/doc/overview.html javadoc.arch=${basedir}/arch.xml diff -r 79437956065f j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java --- a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java Mon Mar 03 13:58:03 2008 +0100 +++ b/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/InstanceProperties.java Tue Mar 04 15:16:56 2008 +0100 @@ -251,6 +251,7 @@ public abstract class InstanceProperties * instance does not exists * @throws InstanceCreationException when instance with same url already * registered + * @see #removeInstance(String) * @since 1.37.0 */ public static InstanceProperties createInstancePropertiesWithoutUI(String url, String username, @@ -260,6 +261,25 @@ public abstract class InstanceProperties ServerInstance inst = registry.getServerInstance(url); InstanceProperties ip = inst.getInstanceProperties(); 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, String, String, String, Map) 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); } /**