public final class RealtimeSystem
extends java.lang.Object
RealtimeSystem
provides a means for tuning the behavior
of the implementation by specifying parameters such as the maximum
number of locks that can be in use concurrently, and the monitor
control policy. In addition, RealtimeSystem
provides a
mechanism for obtaining access to the security manager, garbage
collector, and scheduler, to query or set parameters.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()
Returns a reference to the currently active garbage collector
for the heap.
|
static int |
getConcurrentLocksUsed()
Gets the maximum number of locks that have been used concurrently.
|
static MonitorControl |
getInitialMonitorControl()
Returns the monitor control object that represents the initial
monitor control policy.
|
static int |
getMaximumConcurrentLocks()
Gets the maximum number of locks that can be used concurrently
without incurring an execution time increase as set by the
setMaximumConcurrentLocks() methods. |
static RealtimeSecurity |
getSecurityManager()
Deprecated.
since 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 numLocks)
Sets the anticipated maximum number of locks that may be held
or waited on concurrently.
|
static void |
setMaximumConcurrentLocks(int number,
boolean hard)
Sets the anticipated maximum number of locks that may be held
or waited on concurrently.
|
static void |
setSecurityManager(RealtimeSecurity manager)
Sets a new realtime security 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()
GarbageCollector
object which is the current
collector collecting objects on the conventional Java heap.public static int getConcurrentLocksUsed()
public static int getMaximumConcurrentLocks()
setMaximumConcurrentLocks()
methods.
Note that any relationship between this method and
setMaximumConcurrentLocks
is implementation-specific.
This method returns the actual maximum number of concurrent locks
the platform can currently support, or
Integer.MAX_VALUE
when there is no maximum. The
setMaximumConcurrentLocks
method gives the
implementation a hint as to the maximum number of concurrent locks
it should expect.
@Deprecated public static RealtimeSecurity getSecurityManager()
RealtimeSecurity
object representing the default
realtime security manager.public static void setMaximumConcurrentLocks(int numLocks)
numLocks
- An integer, whose value becomes the number of locks
that can be in simultaneous use without incurring an
execution time increase. When number
is less
than or equal to zero nothing happens. When the system does
not use this hint this method has no effect other than on
the value returned by getMaximumConcurrentLocks()
.public static void setMaximumConcurrentLocks(int number, boolean hard)
number
- The maximum number of locks that can be in
simultaneous use without incurring an execution time
increase. When number
is less than or equal to
zero nothing happens. When the system does not use this hint
this method has no effect other than on the value returned
by getMaximumConcurrentLocks()
.hard
- When true, number
sets a limit. When a lock
is attempted which would cause the number of locks to exceed
number
then a ResourceLimitError
is
thrown. When the system does not limit use of concurrent
locks, this parameter is silently ignored.public static void setSecurityManager(RealtimeSecurity manager)
manager
- A RealtimeSecurity
object which will become
the new security manager.StaticSecurityException
- when security manager has already
been set.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
.