com.ibm.wsspi.kernel.service.utils
Class FrameworkState
java.lang.Object
com.ibm.wsspi.kernel.service.utils.FrameworkState
public class FrameworkState
- extends java.lang.Object
Simple utility for querying the state of the framework for runtime operations.
The OSGi framework system bundle is the single best indicator of when the framework
is in the process of stopping: OSGi stop semantics dictate that the framework
change the system bundle's state to STOPPING before it begins stopping
bundles.
The interrelationship between declared services (DS or Blueprint) means that
service A might be deactivated because a service it requires from another bundle
has gone away (because that bundle has stopped) before its own bundle has stopped.
This utility can be used to curtail scheduling additional asynchronous work
if the framework is stopping.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FrameworkState
public FrameworkState()
isValid
public static boolean isValid()
- Returns:
- True if the framework is in a viable running state.
Will return true when called outside of the osgi environment
isStopping
public static boolean isStopping()
- Returns:
- True if the framework is in the process of stopping,
or has already stopped. If this method is called outside
of an OSGi context, it will return false.