The following table shows which actions are associated with each state. An action of {@code Wait} means this method will block until a statetransition occurs, upon which the new state will be evaluated in order to determine how to proceed. If a state transition does not occur in a reasonable time while waiting then no action is taken and a SubsystemException is thrown to indicate the subsystem was unable to be stopped. An action of {@code Return} means this method returnsimmediately without taking any other action.
State | Action | |
---|---|---|
{@link State#INSTALLING INSTALLING} | {@code Wait} | |
{@link State#INSTALLED INSTALLED} | {@code Return} | |
{@link State#INSTALL_FAILED INSTALL_FAILED} | {@code IllegalStateException} | |
{@link State#RESOLVING RESOLVING} | {@code Wait} | |
{@link State#RESOLVED RESOLVED} | {@code Return} | |
{@link State#STARTING STARTING} | {@code Wait} | |
{@link State#ACTIVE ACTIVE} | {@code Stop} | |
{@link State#STOPPING STOPPING} | {@code Wait} | |
{@link State#UNINSTALLING UNINSTALLING} | {@code IllegalStateException} | |
{@link State#UNINSTALLED UNINSTALLED} | {@code IllegalStateException} |
A subsystem must be persistently stopped. That is, a stopped subsystem must remain stopped across Framework and VM restarts.
All references to changing the state of this subsystem include both changing the state of the subsystem object as well as the state property of the subsystem service registration.
The following steps are required to stop this subsystem.
Implementations should be sensitive to the potential for long running operations and periodically check the current thread for interruption, in which case a SubsystemException with an InterruptedException as the cause should be thrown. If an interruption occurs while waiting, this method should terminate immediately. Once the transition to the {@link State#STOPPING STOPPING} state has occurred, however, this methodmust not terminate due to an interruption until the stop process has completed. @throws SubsystemException If this subsystem fails to stop cleanly. @throws IllegalStateException If this subsystem's state is in{@link State#INSTALL_FAILED INSTALL_FAILED}, {@link State#UNINSTALLING UNINSTALLING}, or {@link State#UNINSTALLED UNINSTALLED}. @throws SecurityException If the caller does not have the appropriate{@link SubsystemPermission}[this,EXECUTE], and the runtime supports permissions.
|
|