javax.realtime
Class RealtimeSystem

java.lang.Object
  |
  +--javax.realtime.RealtimeSystem

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 make queries from them or to set parameters.


Field Summary
static byte BIG_ENDIAN
           
static byte BYTE_ORDER
           
static byte LITTLE_ENDIAN
           
 
Constructor Summary
RealtimeSystem()
           
 
Method Summary
static GarbageCollector currentGC()
          Return a reference to the currently active garbage collector for the heap.
static int getConcurrentLocksUsed()
          Get the maximum number of locks that have been used concurrently.
static int getMaximumConcurrentLocks()
          Get 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()
          Get a reference to the security manager used to control access to real-time system features such as access to physical memory.
static void setMaximumConcurrentLocks(int numLocks)
          Set the anticipated maximum number of locks that may be held or waited on concurrently.
static void setMaximumConcurrentLocks(int number, boolean hard)
          Set the anticipated maximum number of locks that may be held or waited on concurrently.
static void setSecurityManager(RealtimeSecurity manager)
          Set a new real-time security manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIG_ENDIAN

public static final byte BIG_ENDIAN

LITTLE_ENDIAN

public static final byte LITTLE_ENDIAN

BYTE_ORDER

public static final byte BYTE_ORDER
Constructor Detail

RealtimeSystem

public RealtimeSystem()
Method Detail

currentGC

public static GarbageCollector currentGC()
Return a reference to the currently active garbage collector for the heap.
Returns:
A GarbageCollector object which is the current collector collecting objects on the traditional Java heap.

getConcurrentLocksUsed

public static int getConcurrentLocksUsed()
Get the maximum number of locks that have been used concurrently. This value can be used for tuning the concurrent locks parameter, which is used as a hint by systems that use a monitor cache.
Returns:
An int whose value is the number of locks in use at the time of the invocation of the method.

getMaximumConcurrentLocks

public static int getMaximumConcurrentLocks()
Get the maximum number of locks that can be used concurrently without incurring an execution time increase as set by the setMaximumConcurrentLocks() methods.
Returns:
An int whose value is the maximum number of locks that can be in simultaneous use.

getSecurityManager

public static RealtimeSecurity getSecurityManager()
Get a reference to the security manager used to control access to real-time system features such as access to physical memory.
Returns:
A RealtimeSecurity object representing the default real-time security manager.

setMaximumConcurrentLocks

public static void setMaximumConcurrentLocks(int numLocks)
Set the anticipated maximum number of locks that may be held or waited on concurrently. Provide a hint to systems that use a monitor cache as to how much space to dedicate to the cache.
Parameters:
number - An integer whose value becomes the number of locks that can be in simultaneous use without incurring an execution time increase. If number is less than or equal to zero nothing happens.

setMaximumConcurrentLocks

public static void setMaximumConcurrentLocks(int number,
                                             boolean hard)
Set the anticipated maximum number of locks that may be held or waited on concurrently. Provide a limit for the size of the monitor cache on systems that provide one if hard is true.
Parameters:
number - The maximum number of locks that can be in simultaneous use without incurring an execution time increase. If number is less than or equal to zero nothing happens.
hard - If true, number sets a limit. If a lock is attempted which would cause the number of locks to exceed number then a ResourceLimitError is thrown.

setSecurityManager

public static void setSecurityManager(RealtimeSecurity manager)
Set a new real-time security manager.
Parameters:
manager - A RealtimeSecurity object which will become the new security manager.
Throws:
java.lang.SecurityException - Thrown if security manager has already been set.