|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.runmode.RunModeController
public class RunModeController
The RunModeController
enables the user to ponder between
safety and speed of the DRAGOS system. This class provides a number of
switches which may be switched on and off by applications. In general,
disabling all switches results in a 'safe' system with many runtime checks.
When enabling switches, Dragos waives some saftey checks and in general
performs better. However, inconsistencies may occur in the runimte graph.
Users should only use this module when they are perfectly sure about the
consequences.
For performance reasons, the number of switches available is thightly
limited. From the 32 switches totally availabe, the 12 lowest ones are
reserved for system use. Extensions may reserve switches above for their own
purposes.
Field Summary | |
---|---|
static int |
MAX_RUNMODE
maximal runmode switch identifier overall |
static int |
MIN_SYSTEM_RUNMODE
minimal runmode switch identifier overall |
static int |
MIN_USER_RUNMODE
minimal runmode switch identifier for use by extensions |
Constructor Summary | |
---|---|
RunModeController()
|
Method Summary | |
---|---|
static RunModeController |
getInstance()
Returns the one and only instance of the RunModeController. |
java.lang.String |
getRole()
Returns the kernel module's role. |
RunMode |
getRunMode()
retreives the actual run mode instance. |
void |
initialize()
Initializes the kernel module. |
boolean |
isRunModeSwitchReserved(int runModeSwitchID)
Tests whether a certain RunModeSwitch is already reserved. |
static boolean |
isValueEnabledDefault(int value)
Conveinence methd, short for RunModeController.getInstance().getRunMode().isValueEnabled(int) . |
boolean |
releaseRunModeSwitch(int runModeSwitchID,
java.lang.Class<? extends ExtensionDescriptor> requester)
Releases a previously reserved switch given by its identifier. |
boolean |
reserveRunModeSwitch(int runModeSwitchID,
java.lang.Class<? extends ExtensionDescriptor> requester)
Reserves a switch given by its identifier for a certain class,e.g. a VersionDescriptor. |
void |
uninitialize()
Uninitializes the kernel module and releases all resources used by it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIN_SYSTEM_RUNMODE
public static final int MIN_USER_RUNMODE
public static final int MAX_RUNMODE
Constructor Detail |
---|
public RunModeController()
Method Detail |
---|
public static RunModeController getInstance()
ModuleManager
.
This module is automatically loaded by the Dragos Kernel
.
null
if not activepublic java.lang.String getRole()
getRole
in interface KernelModule
public void initialize()
initialize
in interface KernelModule
public void uninitialize()
uninitialize
in interface KernelModule
public RunMode getRunMode()
public boolean reserveRunModeSwitch(int runModeSwitchID, java.lang.Class<? extends ExtensionDescriptor> requester)
runModeSwitchID
- the switch to reserverequester
- the class to reserve the switch for, e.g. a VersionDescriptor
true
if the switch has been reserved or was
already reserved for the given requester. false
if
the switch is reserved to another class.public boolean releaseRunModeSwitch(int runModeSwitchID, java.lang.Class<? extends ExtensionDescriptor> requester)
runModeSwitchID
- the switch to releaserequester
- the class to reserve the switch for, e.g. an ExtensionDescriptor
true
if the switch had been reserved for the
requester and therefore has been released. false
if the switch had been reserved by another class or not at all.public boolean isRunModeSwitchReserved(int runModeSwitchID)
runModeSwitchID
- the runmode switch to test, must be >=
MIN_USER_RUNMODE
and <=
MAX_RUNMODE
.
true
if the switch is reserved by an extension or
belongs to system space, false
otherwise.public static boolean isValueEnabledDefault(int value)
RunModeController.getInstance().getRunMode().isValueEnabled(int)
.
value
- switch to test
true
if the switch is enabled, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |