public final class RealtimeSystem extends Object
Jamaica Real-Time Specification for Java class RealtimeSystem.
This class provides access to global status information on the real-time system and the Real-Time Specification for Java status. This includes memory related information (endianess, GC), Java monitor information and security.
Modifier and Type | Field and Description |
---|---|
static byte |
BIG_ENDIAN
Deprecated.
RTSJ 2.0
|
static byte |
BYTE_ORDER
Deprecated.
RTSJ 2.0
|
static byte |
LITTLE_ENDIAN
Deprecated.
RTSJ 2.0
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canEnforceAllocationRate()
Determines whether or not allocation rate enforcement is supported.
|
static boolean |
canEnforceCost()
Determines whether or not hard cost enforcement is supported.
|
static GarbageCollector |
currentGC()
currentGC returns the singleton instance of the garbage
collector used by the system to recycle memory allocated in
HeapMemory.
|
static int |
getConcurrentLocksUsed()
getConcurrentLocksUsed returns the number of locks that have been
used concurrently by the system.
|
static MonitorControl |
getInitialMonitorControl()
Get the monitor control object of the policy that is used during
system startup.
|
static int |
getMaximumConcurrentLocks()
getMaximumConcurrentLocks returns the number of locks that may be
used concurrently without requiring an extra overhead (for
allocating an extra monitor object or similar).
|
static RealtimeSecurity |
getSecurityManager()
Deprecated.
RTSJ 2.0
|
static boolean |
hasUniversalClock()
Determines whether or not this system supports a universal time clock.
|
static int |
modules()
The set of modules supported.
|
static void |
setMaximumConcurrentLocks(int max)
setMaximumConcurrentLocks sets the maximum number of locks that
may be used simultaneously.
|
static void |
setMaximumConcurrentLocks(int max,
boolean hard)
setMaximumConcurrentLocks sets the maximum number of locks that
may be used simultaneously.
|
static void |
setSecurityManager(RealtimeSecurity manager)
setSecurityManager replaces the current security manager by a new
manager.
|
static boolean |
supports(RTSJModule module)
Determines whether or not a particular module is supported.
|
@Deprecated public static final byte BIG_ENDIAN
@Deprecated public static final byte LITTLE_ENDIAN
@Deprecated public static final byte BYTE_ORDER
public static GarbageCollector currentGC()
currentGC returns the singleton instance of the garbage collector used by the system to recycle memory allocated in HeapMemory. For JamaicaVM, this is the garbage collector described in
Fridtjof Siebert, Hard Real-Time Garbage Collection in Modern Object Oriented Programming Languages, aicas GmbH, Karlsruhe, 2002, ISBN 3-8311-3893-1
public static int getConcurrentLocksUsed()
public static int getMaximumConcurrentLocks()
getMaximumConcurrentLocks returns the number of locks that may be used concurrently without requiring an extra overhead (for allocating an extra monitor object or similar).
For JamaicaVM, there is not restriction on the number of locks that may be used concurrently, and there is no extra overhead on the use of a lock since all required information is inlined. This function returns Integer.MAX_VALUE for JamaicaVM.
@Deprecated public static RealtimeSecurity getSecurityManager()
public static void setMaximumConcurrentLocks(int max)
setMaximumConcurrentLocks sets the maximum number of locks that may be used simultaneously. This may be used by systems that require a preallocated set of locks for efficient monitor access.
In JamaicaVM, no allocation of specific memory of locks is required, this function has no effect in JamaicaVM.
max
- The maximum number of locks.public static void setMaximumConcurrentLocks(int max, boolean hard)
setMaximumConcurrentLocks sets the maximum number of locks that may be used simultaneously. This may be used by systems that require a preallocated set of locks for efficient monitor access.
In JamaicaVM, no allocation of specific memory of locks is required, this function has no effect in JamaicaVM.
max
- The maximum number of locks.hard
- if this parameter is set, exceeding the number of
permitted locks at runtime will cause a ResourceLimitError. On
JamaicaVM, there is no such limit, so this parameter is ignored.public static void setSecurityManager(RealtimeSecurity manager)
IllegalArgumentException
- if manger is null.SecurityException
- if the security manager has already
been set.manager
- the new security manager.public static MonitorControl getInitialMonitorControl()
public static boolean supports(RTSJModule module)
module
- The identifier of the module to be checked for support.true
when module
is supported; otherwise
false
.public static int modules()
public static boolean hasUniversalClock()
true
when the system can provide a universal time clock.public static boolean canEnforceCost()
true
when cost enforcement is supported;
otherwise false
.public static boolean canEnforceAllocationRate()
true
when allocation rate enforcement is supported,
otherwise false
.