javax.realtime
Class LTPhysicalMemory

java.lang.Object
  extended by javax.realtime.MemoryArea
      extended by javax.realtime.ScopedMemory
          extended by javax.realtime.LTPhysicalMemory

public class LTPhysicalMemory
extends ScopedMemory

An instance of LTPhysicalMemory allows objects to be allocated from a range of physical memory with particular attributes, determined by their memory type. This memory area has the same semantics as ScopedMemory memory areas, and the same performance restrictions as LTMemory.

No provision is made for sharing object in LTPhysicalMemory with entities outside the JVM that creates them, and, while the memory backing an instance of LTPhysicalMemory could be shared by multiple JVMs, the class does not support such sharing.

Methods from LTPhysicalMemory should be overridden only by methods that use super.

See Also:
MemoryArea, ScopedMemory, VTMemory, LTMemory, VTPhysicalMemory, ImmortalPhysicalMemory, RealtimeThread, NoHeapRealtimeThread

Constructor Summary
LTPhysicalMemory(java.lang.Object type, long size)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, long base, long size)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, long base, long size, java.lang.Runnable logic)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, long size, java.lang.Runnable logic)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, long base, SizeEstimator size)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, long base, SizeEstimator size, java.lang.Runnable logic)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, SizeEstimator size)
          Create an instance of LTPhysicalMemory with the given parameters.
LTPhysicalMemory(java.lang.Object type, SizeEstimator size, java.lang.Runnable logic)
          Create an instance of LTPhysicalMemory with the given parameters.
 
Method Summary
 java.lang.String toString()
          Creates a string describing this object.
 
Methods inherited from class javax.realtime.ScopedMemory
enter, enter, executeInArea, getMaximumSize, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, newArray, newInstance, newInstance, setPortal
 
Methods inherited from class javax.realtime.MemoryArea
getMemoryArea, memoryConsumed, memoryRemaining, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long size)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
size - The size of the area in bytes.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
java.lang.IllegalArgumentException - Thrown if size is less than zero.
SizeOutOfBoundsException - Thrown if the implementation detects size extends beyond physically addressable memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if type specifies incompatible memory attributes.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long base,
                        long size)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
base - The physical memory address of the area.
size - The size of the area in bytes.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException - Thrown if the size is less than zero, or the implementation detects that base plus size extends beyond physically addressable memory.
OffsetOutOfBoundsException - Thrown if the address is invalid.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the requested type, or if type specifies incompatible memory attributes.
java.lang.IllegalArgumentException - Thrown if size is less than zero.
MemoryInUseException - Thrown if the specified memory is already in use.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        SizeEstimator size)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
size - A size estimator for this area.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException - Thrown if the implementation detects that size extends beyond physically addressable memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if type specifies incompatible memory attributes.
java.lang.IllegalArgumentException - Thrown if size is null, or size.getEstimate() is negative.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long base,
                        SizeEstimator size)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
base - The physical memory address of the area.
size - A size estimator for this memory area.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException - Thrown if the implementation detects that base plus the size estimate extends beyond physically addressable memory.
OffsetOutOfBoundsException - Thrown if the address is invalid.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the requested type, or if type specifies incompatible memory attributes.
MemoryInUseException - Thrown if the specified memory is already in use.
java.lang.IllegalArgumentException - Thrown if size is null, or size.getEstimate() is negative.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long size,
                        java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
size - The size of the area in bytes.
logic - The run() method of this object will be called whenever MemoryArea.enter() is called. If logic is null, logic must be supplied when the memory area is entered.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
java.lang.IllegalArgumentException - Thrown if size is less than zero.
SizeOutOfBoundsException - Thrown if the implementation detects that size extends beyond physically addressable memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the requested type, or if type specifies incompatible memory attributes.
IllegalAssignmentError - Thrown if storing logic in this would violate the assignment rules.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long base,
                        long size,
                        java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
base - The physical memory address of the area.
size - The size of the area in bytes.
logic - The run() method of this object will be called whenever MemoryArea.enter() is called. If logic is null, logic must be supplied when the memory area is entered.
Throws:
SizeOutOfBoundsException - Thrown if the implementation detects that base plus size extends beyond physically addressable memory.
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
java.lang.IllegalArgumentException - Thrown if size is less than zero.
OffsetOutOfBoundsException - Thrown if the address is invalid.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the requested type, or if type specifies incompatible memory attributes.
MemoryInUseException - Thrown if the specified memory is already in use.
IllegalAssignmentError - Thrown if storing logic in this would violate the assignment rules.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        SizeEstimator size,
                        java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
size - A size estimator for this area.
logic - The run() method of this object will be called whenever MemoryArea.enter() is called. If logic is null, logic must be supplied when the memory area is entered.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException - Thrown if the implementation detects that base plus the size estimate extends beyond physically addressable memory.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the request type, or if type specifies attributes with a conflict.
java.lang.IllegalArgumentException - Thrown if size is null, or size.getEstimate() is negative.
IllegalAssignmentError - Thrown if storing logic in this would violate the assignment rules.
See Also:
PhysicalMemoryManager

LTPhysicalMemory

public LTPhysicalMemory(java.lang.Object type,
                        long base,
                        SizeEstimator size,
                        java.lang.Runnable logic)
Create an instance of LTPhysicalMemory with the given parameters.

Parameters:
type - An instance of Object representing the type of memory required (e.g., dma, shared) - used to define the base address and control the mapping. If the required memory has more than one attribute, type may be an array of objects. If type is null or a reference to an array with no entries, any type of memory is acceptable. Note that type values are compared by reference (==), not by value (equals).
base - The physical memory address of the area.
size - A size estimator for this memory area.
logic - The run() method of this object will be called whenever MemoryArea.enter() is called. If logic is null, logic must be supplied when the memory area is entered.
Throws:
java.lang.SecurityException - Thrown if the application doesn't have permissions to access physical memory or the given type of memory.
SizeOutOfBoundsException - Thrown if the implementation detects that base plus the size estimate extends beyond physically addressable memory.
OffsetOutOfBoundsException - Thrown if the address is invalid.
UnsupportedPhysicalMemoryException - Thrown if the underlying hardware does not support the given type, or if no matching PhysicalMemoryTypeFilter has been registered with the PhysicalMemoryManager.
MemoryTypeConflictException - Thrown if the specified base does not point to memory that matches the requested type, or if type specifies incompatible memory attributes.
MemoryInUseException - Thrown if the specified memory is already in use.
java.lang.IllegalArgumentException - Thrown if size is null, or size.getEstimate() is negative.
IllegalAssignmentError - Thrown if storing logic in this would violate the assignment rules.
See Also:
PhysicalMemoryManager
Method Detail

toString

public java.lang.String toString()
Creates a string describing this object. The string is of the form
 (LTPhysicalMemory) Scoped memory # num
 
where num is a number that uniquely identifies this LTPhysicalMemory memory area. representing the value of this.

Overrides:
toString in class ScopedMemory
Returns:
A string representing the value of this.