| java.lang.Object com.sun.midp.suspend.AbstractSubsystem
All known Subclasses: com.sun.midp.suspend.NetworkSubsystem, com.sun.midp.suspend.SuspendSystem,
AbstractSubsystem | abstract public class AbstractSubsystem implements Subsystem(Code) | | An abstract subsystem that may contain other subsystems.
Contained subsytems are suspended after this subsystem suspend
and resumed prior to the subsystem resuming.
|
Method Summary | |
public void | addSuspendDependency(SuspendDependency dep) Adds a dependency that prevents from system suspend. | final public int | getState() Returns the current state. | public void | registerSubsystem(Subsystem s) Registers a subsystem this one depends on. | public void | removeSuspendDependency(SuspendDependency dep) Removes dependency that does not prevent from system suspend any more. | final public void | resume() If the current state is SUSPENDED , changes the state to
RESUMING , performs object-specific activation
operations and then changes the state to ACTIVE . | protected void | resumeImpl() Performs object-specific activation operations. | void | resumed() Confirms subsystem has been resumed. | public void | suspend() If the current state is ACTIVE , changes the state to
SUSPENDING , and initiates suspend routine. | protected void | suspendImpl() Performs object-specific suspend operations. | void | suspended() Confirms subsystem has been suspended. | public void | unregisterSubsystem(Subsystem s) Unregisters a subsystem this one depends on. | protected void | updateSuspendStatus() Checks if there are dependencies that prevent from system suspend,
if there are no ones, and the state is SUSPENDING suspend routine. |
classSecurityToken | static SecurityToken classSecurityToken(Code) | | Security token for provileged access to internal API's.
Note it must stay package private.
|
lock | final Object lock(Code) | | State transition synchronization lock.
|
state | int state(Code) | | Current subsystem state.
|
addSuspendDependency | public void addSuspendDependency(SuspendDependency dep)(Code) | | Adds a dependency that prevents from system suspend.
Parameters: dep - dependency to add |
getState | final public int getState()(Code) | | Returns the current state.
current state if the subsystem |
registerSubsystem | public void registerSubsystem(Subsystem s)(Code) | | Registers a subsystem this one depends on.
Parameters: s - subsystem this one depends on. |
removeSuspendDependency | public void removeSuspendDependency(SuspendDependency dep)(Code) | | Removes dependency that does not prevent from system suspend any more.
Then invokes suspend notification if there are no dependencies left.
Parameters: dep - dependency to remove |
resume | final public void resume() throws StateTransitionException(Code) | | If the current state is SUSPENDED , changes the state to
RESUMING , performs object-specific activation
operations and then changes the state to ACTIVE .
|
resumeImpl | protected void resumeImpl()(Code) | | Performs object-specific activation operations.
Default implementation makes nothing.
|
resumed | void resumed()(Code) | | Confirms subsystem has been resumed. Listeners/waiters
can be invoked here.
|
suspend | public void suspend() throws StateTransitionException(Code) | | If the current state is ACTIVE , changes the state to
SUSPENDING , and initiates suspend routine. The suspend
routine is pstponed until all suspend dependences are removed.
If there are no dependencies currently, the suspend routine is
invoked immediately.
|
suspendImpl | protected void suspendImpl()(Code) | | Performs object-specific suspend operations.
Default implementation makes nothing.
|
suspended | void suspended()(Code) | | Confirms subsystem has been suspended. Listeners/waiters
can be invoked here.
|
unregisterSubsystem | public void unregisterSubsystem(Subsystem s)(Code) | | Unregisters a subsystem this one depends on.
Parameters: s - subsystem this one depends on. |
updateSuspendStatus | protected void updateSuspendStatus()(Code) | | Checks if there are dependencies that prevent from system suspend,
if there are no ones, and the state is SUSPENDING suspend routine.
The suspend routine performs first object-specific ations then
invokes suspend() methods for all registered subsytems.
|
|
|