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.
Issue #54291 requires disallowing user to start server when it is in suspended mode, i.e. debugger is connected and waiting on breakpoint. We are now unable to implement it on j2eeserver level because retrieving debug info from AS8.1 requires non-null target for getDebugInfo() method. We'd like to be able to get server state on the plugin level, thus adding isDebuggable() method to the StartServer class. This method is analogical to isRunning() method added earlier.
StartServer's code: /** * Returns true if this admin server is suspended. */ public abstract boolean isSuspended(); /** * Returns true if given target is suspended. This should be * overwritten by plugins which support multiple target servers via * one admin server. * @param target the target server in question; null value implies * the query is against the admin server. * @return true if the server is question is running. * @since 1.6 */ public boolean isSuspended(Target target) { if (target == null || isAlsoTargetServer(target)) { return isSuspended(); } return false; }
<change id="StartServer-isSuspended"> <api name="plugins"/> <summary>StartServer methods for SUSPENDED state detection.</summary> <version major="1" minor="6"/> <date day="24" month="3" year="2005"/> <author login="lkotouc"/> <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/> <description> <p> J2eeserver has to be able to detect server in suspended state to disallow user to start server again. Methods isRunning and isRunning(Target)are added as StartServer abstract class plugin SPI. </p> </description> <class package="org.netbeans.modules.j2ee.deployment.plugins.api" name="StartServer"/> <issue number="53010"/> </change>
apichanges.xml (version abonve is incorrect): <change id="StartServer-isSuspended"> <api name="plugins"/> <summary>StartServer methods for SUSPENDED state detection.</summary> <version major="1" minor="6"/> <date day="24" month="3" year="2005"/> <author login="lkotouc"/> <compatibility binary="incompatible" source="incompatible" semantic="incompatible" addition="yes"/> <description> <p> J2eeserver has to be able to detect server in suspended state to disallow user to start server again. Methods isSuspended and isSuspended(Target)are added as StartServer abstract class plugin SPI. </p> </description> <class package="org.netbeans.modules.j2ee.deployment.plugins.api" name="StartServer"/> <issue number="54291"/> </change>
Created attachment 21101 [details] j2eeserver.diff
Created attachment 21102 [details] J2EEServerAPI.zip
Please review this api change. Using the API_REVIEW_FAST keyword since the change is trivial, though incompatible.
Just curious: I've seen that the API in j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api consists mainly of interfaces and abstract classes. Do you plan to slit it into API and SPI parts in the future so that the API part would just contain final classes delegating to the SPI and the SPI would contain interfaces for implementations?
Intent reached by fixing issue #54291 - on j2eeserver level.
This mixture of plugin API and SPI is a known problem which should be solved as part of issue 50944 - "Split j2eeserver module into smaller parts".